input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testGetBuilder ( ) { org . apache . olingo . odata2 . jpa . processor . api . access . JPAEdmBuilder builder = org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmAssociationEndTest . objJPAEdmAssociationEnd . getBuilder ( ) ; "<AssertPlaceHolder>" ; } getBuilder ( ) { if ( ( builder ) == null ) { builder = new org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmReferentialConstraint . JPAEdmRefConstraintBuilder ( ) ; } return builder ; } | org . junit . Assert . assertNotNull ( builder ) |
testGet_3 ( ) { com . jmethods . catatumbo . impl . LRUCache < java . lang . Integer , java . lang . Integer > squaresCache = new com . jmethods . catatumbo . impl . LRUCache ( 5 , 10 ) ; for ( int i = 1 ; i <= 10 ; i ++ ) { squaresCache . put ( i , ( i * i ) ) ; } squaresCache . get ( 1 ) ; squaresCache . put ( 11 , ( 11 * 11 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( ( ( squaresCache . size ( ) ) == 10 ) && ( ( squaresCache . get ( 1 ) ) != null ) ) && ( ( squaresCache . get ( 11 ) ) != null ) ) ) |
testUpdateStateWithPercentType ( ) { org . eclipse . smarthome . core . library . items . ColorItem item = new org . eclipse . smarthome . core . library . items . ColorItem ( "test" ) ; item . setState ( new org . eclipse . smarthome . core . library . types . HSBType ( new org . eclipse . smarthome . core . library . types . DecimalType ( 75 ) , new org . eclipse . smarthome . core . library . types . PercentType ( 75 ) , new org . eclipse . smarthome . core . library . types . PercentType ( 75 ) ) ) ; item . setState ( new org . eclipse . smarthome . core . library . types . PercentType ( 50 ) ) ; "<AssertPlaceHolder>" ; } getState ( ) { return state ; } | org . junit . Assert . assertEquals ( new org . eclipse . smarthome . core . library . types . HSBType ( new org . eclipse . smarthome . core . library . types . DecimalType ( 75 ) , new org . eclipse . smarthome . core . library . types . PercentType ( 75 ) , new org . eclipse . smarthome . core . library . types . PercentType ( 50 ) ) , item . getState ( ) ) |
retriggerTest ( ) { pk = new org . candlepin . pinsetter . core . PinsetterKernel ( config , jfactory , jlistener , jcurator , sfactory , triggerListener , modeManager ) ; java . lang . String job = "CancelJobJob" ; org . quartz . TriggerKey key = new org . quartz . TriggerKey ( job ) ; java . util . Set < org . quartz . TriggerKey > keys = new java . util . HashSet ( ) ; keys . add ( key ) ; when ( sched . getTriggerKeys ( any ( org . candlepin . pinsetter . core . GroupMatcher . class ) ) ) . thenReturn ( keys ) ; pk . retriggerCronJob ( job , org . candlepin . pinsetter . tasks . CancelJobJob . class ) ; org . mockito . ArgumentCaptor < org . quartz . Trigger > triggerCaptor = org . mockito . ArgumentCaptor . forClass ( org . quartz . Trigger . class ) ; verify ( sched ) . rescheduleJob ( eq ( key ) , triggerCaptor . capture ( ) ) ; org . quartz . Trigger capturedTrigger = triggerCaptor . getValue ( ) ; org . quartz . TriggerKey keynow = capturedTrigger . getKey ( ) ; java . lang . String name = keynow . getName ( ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return key ; } | org . junit . Assert . assertTrue ( capturedTrigger . getKey ( ) . getName ( ) . startsWith ( job ) ) |
should_use_TypeRef_to_access_field ( ) { org . fest . reflect . core . Reflection_field_Test . Jedi jedi = new org . fest . reflect . core . Reflection_field_Test . Jedi ( ) ; java . util . List < java . lang . String > powers = org . fest . reflect . core . Reflection . field ( "powers" ) . ofType ( new org . fest . reflect . reference . TypeRef < java . util . List < java . lang . String > > ( ) { } ) . in ( jedi ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { try { java . lang . Object value = descriptor . getReadMethod ( ) . invoke ( target ) ; return castSafely ( value , propertyType ) ; } catch ( java . lang . Throwable t ) { java . lang . String msg = java . lang . String . format ( "Failed<sp>to<sp>get<sp>the<sp>value<sp>of<sp>property<sp>'%s'" , descriptor . getName ( ) ) ; throw new org . fest . reflect . exception . ReflectionError ( msg , t ) ; } } | org . junit . Assert . assertSame ( jedi . powers , powers ) |
test2 ( ) { it . Main main = new it . Main ( ) ; main . setId ( "test2" ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( "test2" , main . getId ( ) ) |
testGetRelevantAtomContainer_IReaction_IBond ( ) { java . util . Iterator < org . openscience . cdk . interfaces . IAtomContainer > atomContainers = org . openscience . cdk . tools . manipulator . ReactionManipulator . getAllAtomContainers ( reaction ) . iterator ( ) ; while ( atomContainers . hasNext ( ) ) { org . openscience . cdk . interfaces . IAtomContainer container = atomContainers . next ( ) ; org . openscience . cdk . interfaces . IBond aBond = container . getBond ( 0 ) ; "<AssertPlaceHolder>" ; } } getRelevantAtomContainer ( org . openscience . cdk . interfaces . IReaction , org . openscience . cdk . interfaces . IAtom ) { org . openscience . cdk . interfaces . IAtomContainer result = org . openscience . cdk . tools . manipulator . MoleculeSetManipulator . getRelevantAtomContainer ( reaction . getReactants ( ) , atom ) ; if ( result != null ) { return result ; } return org . openscience . cdk . tools . manipulator . MoleculeSetManipulator . getRelevantAtomContainer ( reaction . getProducts ( ) , atom ) ; } | org . junit . Assert . assertEquals ( container , org . openscience . cdk . tools . manipulator . ReactionManipulator . getRelevantAtomContainer ( reaction , aBond ) ) |
trimLabelsDays4 ( ) { java . util . List < java . lang . String > input = java . util . Arrays . asList ( "2014/11/28<sp>00:00:00.000000000" , "2014/11/29<sp>00:00:00.000000000" , "2014/11/30<sp>00:00:00.000000000" , "2014/12/01<sp>00:00:00.000000000" , "2014/12/02<sp>00:00:00.000000000" ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "2014/11/28" , "11/29" , "11/30" , "12/01" , "12/02" ) ; java . util . List < java . lang . String > found = org . diirt . graphene . TimeScales . trimLabels ( input ) ; "<AssertPlaceHolder>" ; } trimLabels ( java . util . List ) { if ( ( labels . size ( ) ) <= 1 ) { return labels ; } int greatestChangingPrecision = org . diirt . graphene . TimeScales . calculateGreatestChangingField ( labels ) ; java . util . ArrayList < java . lang . String > rtn = new java . util . ArrayList < java . lang . String > ( labels . size ( ) ) ; org . diirt . graphene . TimeScales . DateTrimmer firstDate = new org . diirt . graphene . TimeScales . DateTrimmer ( labels . get ( 0 ) ) ; rtn . add ( firstDate . getCompactForm ( org . diirt . graphene . TimeScales . DateTrimmer . NO_PRECISION , greatestChangingPrecision ) ) ; for ( int i = 1 ; i < ( labels . size ( ) ) ; i ++ ) { java . lang . String prevLabel = labels . get ( ( i - 1 ) ) ; java . lang . String nextLabel = labels . get ( i ) ; int redundancePrecision = org . diirt . graphene . TimeScales . greatestRedundancePrecision ( prevLabel , nextLabel ) ; org . diirt . graphene . TimeScales . DateTrimmer f = new org . diirt . graphene . TimeScales . DateTrimmer ( nextLabel ) ; java . lang . String trimmedLabel = f . getCompactForm ( redundancePrecision , greatestChangingPrecision ) ; rtn . add ( trimmedLabel ) ; } return rtn ; } | org . junit . Assert . assertThat ( found , equalTo ( expected ) ) |
testSqrtModPrime ( ) { for ( java . math . BigInteger p : new java . math . BigInteger [ ] { ch . bfh . unicrypt . helper . math . MathUtilTest . TWO , ch . bfh . unicrypt . helper . math . MathUtilTest . THREE , ch . bfh . unicrypt . helper . math . MathUtilTest . FIVE , ch . bfh . unicrypt . helper . math . MathUtilTest . SEVEN , java . math . BigInteger . valueOf ( 97 ) } ) { for ( int i = 1 ; i < ( p . intValue ( ) ) ; i ++ ) { java . math . BigInteger bi = java . math . BigInteger . valueOf ( i ) ; java . math . BigInteger bi_square = bi . modPow ( ch . bfh . unicrypt . helper . math . MathUtilTest . TWO , p ) ; java . math . BigInteger bi_square_sqrt = ch . bfh . unicrypt . helper . math . MathUtil . sqrtModPrime ( bi_square , p ) ; "<AssertPlaceHolder>" ; } } } sqrtModPrime ( java . math . BigInteger , java . math . BigInteger ) { if ( p . equals ( ch . bfh . unicrypt . helper . math . MathUtil . TWO ) ) { return ch . bfh . unicrypt . helper . math . MathUtil . ONE ; } if ( p . mod ( ch . bfh . unicrypt . helper . math . MathUtil . FOUR ) . equals ( ch . bfh . unicrypt . helper . math . MathUtil . THREE ) ) { return ch . bfh . unicrypt . helper . math . MathUtil . modExp ( x , p . add ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) . divide ( ch . bfh . unicrypt . helper . math . MathUtil . FOUR ) , p ) ; } java . math . BigInteger z = ch . bfh . unicrypt . helper . math . MathUtil . TWO ; while ( ch . bfh . unicrypt . helper . math . MathUtil . isQuadraticResidue ( z , p ) ) { z = z . add ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) ; } java . math . BigInteger s = ch . bfh . unicrypt . helper . math . MathUtil . ONE ; java . math . BigInteger q = p . subtract ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) . divide ( ch . bfh . unicrypt . helper . math . MathUtil . TWO ) ; while ( q . mod ( ch . bfh . unicrypt . helper . math . MathUtil . TWO ) . equals ( ch . bfh . unicrypt . helper . math . MathUtil . ZERO ) ) { q = q . divide ( ch . bfh . unicrypt . helper . math . MathUtil . TWO ) ; s = s . add ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) ; } java . math . BigInteger c = ch . bfh . unicrypt . helper . math . MathUtil . modExp ( z , q , p ) ; java . math . BigInteger r = ch . bfh . unicrypt . helper . math . MathUtil . modExp ( x , q . add ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) . divide ( ch . bfh . unicrypt . helper . math . MathUtil . TWO ) , p ) ; java . math . BigInteger t = ch . bfh . unicrypt . helper . math . MathUtil . modExp ( x , q , p ) ; java . math . BigInteger m = s ; while ( ! ( t . equals ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) ) ) { java . math . BigInteger i = ch . bfh . unicrypt . helper . math . MathUtil . ZERO ; while ( ! ( ch . bfh . unicrypt . helper . math . MathUtil . ONE . equals ( ch . bfh . unicrypt . helper . math . MathUtil . modExp ( t , ch . bfh . unicrypt . helper . math . MathUtil . modExp ( ch . bfh . unicrypt . helper . math . MathUtil . TWO , i , p ) , p ) ) ) ) { i = i . add ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) ; } java . math . BigInteger b = ch . bfh . unicrypt . helper . math . MathUtil . modExp ( c , ch . bfh . unicrypt . helper . math . MathUtil . modExp ( ch . bfh . unicrypt . helper . math . MathUtil . TWO , m . subtract ( i ) . subtract ( ch . bfh . unicrypt . helper . math . MathUtil . ONE ) , p ) , p ) ; r = r . multiply ( b ) . mod ( p ) ; t = t . multiply ( b . pow ( 2 ) ) . mod ( p ) ; c = ch . bfh . unicrypt . helper . math . MathUtil . modExp ( b , ch . bfh . unicrypt . helper . math . MathUtil . TWO , p ) ; m = i ; } return r ; } | org . junit . Assert . assertEquals ( bi_square , bi_square_sqrt . modPow ( ch . bfh . unicrypt . helper . math . MathUtilTest . TWO , p ) ) |
testValidateSchemaNewFieldWithDefault ( ) { final org . apache . avro . List < org . apache . avro . Schema . Field > readerFields = list ( new org . apache . avro . Schema . Field ( "oldfield1" , INT_SCHEMA , null , null ) , new org . apache . avro . Schema . Field ( "newfield1" , INT_SCHEMA , null , 42 ) ) ; final org . apache . avro . Schema reader = org . apache . avro . Schema . createRecord ( readerFields ) ; final org . apache . avro . SchemaCompatibility . SchemaCompatibility . SchemaPairCompatibility expectedResult = new org . apache . avro . SchemaCompatibility . SchemaCompatibility . SchemaPairCompatibility ( SchemaCompatibility . SchemaCompatibilityResult . compatible ( ) , reader , org . apache . avro . TestSchemaCompatibility . WRITER_SCHEMA , org . apache . avro . SchemaCompatibility . SchemaCompatibility . READER_WRITER_COMPATIBLE_MESSAGE ) ; "<AssertPlaceHolder>" ; } checkReaderWriterCompatibility ( org . apache . avro . Schema , org . apache . avro . Schema ) { final org . apache . avro . SchemaCompatibility . SchemaCompatibilityResult compatibility = new org . apache . avro . SchemaCompatibility . ReaderWriterCompatibilityChecker ( ) . getCompatibility ( reader , writer ) ; final java . lang . String message ; switch ( compatibility . getCompatibility ( ) ) { case INCOMPATIBLE : { message = java . lang . String . format ( ( "Data<sp>encoded<sp>using<sp>writer<sp>schema:%n%s%n" + "will<sp>or<sp>may<sp>fail<sp>to<sp>decode<sp>using<sp>reader<sp>schema:%n%s%n" ) , writer . toString ( true ) , reader . toString ( true ) ) ; break ; } case COMPATIBLE : { message = org . apache . avro . SchemaCompatibility . READER_WRITER_COMPATIBLE_MESSAGE ; break ; } default : throw new org . apache . avro . AvroRuntimeException ( ( "Unknown<sp>compatibility:<sp>" + compatibility ) ) ; } return new org . apache . avro . SchemaCompatibility . SchemaPairCompatibility ( compatibility , reader , writer , message ) ; } | org . junit . Assert . assertEquals ( expectedResult , checkReaderWriterCompatibility ( reader , org . apache . avro . TestSchemaCompatibility . WRITER_SCHEMA ) ) |
testGetBooleanSameSizeArray ( ) { com . eclipsesource . v8 . V8Array a = v8 . executeArrayScript ( "[true,<sp>false,<sp>false,<sp>true]" ) ; boolean [ ] result = new boolean [ 4 ] ; int size = a . getBooleans ( 0 , 4 , result ) ; "<AssertPlaceHolder>" ; a . close ( ) ; } executeArrayScript ( java . lang . String ) { return executeArrayScript ( script , null , 0 ) ; } | org . junit . Assert . assertEquals ( 4 , size ) |
testExportCSVSpecifiedColumns ( ) { net . casper . data . model . CBuilder builder = new net . casper . io . file . in . CBuildFromFile ( patientsCSV , "patientsCSV" , columnNames , columnOptionalReaders , PKs ) ; net . casper . data . model . CDataCacheContainer container = new net . casper . data . model . CDataCacheContainer ( builder ) ; "<AssertPlaceHolder>" ; net . casper . io . file . out . CExportCSV csv = new net . casper . io . file . out . CExportCSV ( patientsCSVExport2 , "refnum,sex,crefnum,age" ) ; container . export ( csv ) ; } size ( ) { return list . size ( ) ; } | org . junit . Assert . assertEquals ( 4 , container . size ( ) ) |
testIsValidDefinitionException ( ) { org . apache . tiles . request . Request request = createMock ( org . apache . tiles . request . Request . class ) ; expect ( definitionsFactory . getDefinition ( "definition" , request ) ) . andThrow ( new org . apache . tiles . definition . NoSuchDefinitionException ( ) ) ; replay ( applicationContext , attributeEvaluatorFactory , definitionsFactory , preparerFactory , rendererFactory , request ) ; "<AssertPlaceHolder>" ; verify ( applicationContext , attributeEvaluatorFactory , definitionsFactory , preparerFactory , rendererFactory , request ) ; } isValidDefinition ( java . lang . String , org . apache . tiles . request . Request ) { return container . isValidDefinition ( definition , request ) ; } | org . junit . Assert . assertFalse ( container . isValidDefinition ( "definition" , request ) ) |
testEvaluateFilterPropFilterAgainstException ( ) { org . unitedinternet . cosmo . calendar . query . CalendarFilterEvaluater evaluater = new org . unitedinternet . cosmo . calendar . query . CalendarFilterEvaluater ( ) ; net . fortuna . ical4j . model . Calendar calendar = getCalendar ( "event_with_exception.ics" ) ; org . unitedinternet . cosmo . calendar . query . CalendarFilter filter = new org . unitedinternet . cosmo . calendar . query . CalendarFilter ( ) ; org . unitedinternet . cosmo . calendar . query . ComponentFilter compFilter = new org . unitedinternet . cosmo . calendar . query . ComponentFilter ( "VCALENDAR" ) ; org . unitedinternet . cosmo . calendar . query . ComponentFilter eventFilter = new org . unitedinternet . cosmo . calendar . query . ComponentFilter ( "VEVENT" ) ; filter . setFilter ( compFilter ) ; compFilter . getComponentFilters ( ) . add ( eventFilter ) ; org . unitedinternet . cosmo . calendar . query . PropertyFilter propFilter = new org . unitedinternet . cosmo . calendar . query . PropertyFilter ( "DESCRIPTION" ) ; eventFilter . getPropFilters ( ) . add ( propFilter ) ; "<AssertPlaceHolder>" ; } evaluate ( org . unitedinternet . cosmo . model . Item , org . unitedinternet . cosmo . dav . acl . DavPrivilege ) { if ( org . unitedinternet . cosmo . dav . acl . UserAclEvaluator . LOG . isDebugEnabled ( ) ) { org . unitedinternet . cosmo . dav . acl . UserAclEvaluator . LOG . debug ( ( ( ( ( ( ( ( "Evaluating<sp>privilege<sp>" + privilege ) + "<sp>against<sp>item<sp>'" ) + ( item . getName ( ) ) ) + "'<sp>owned<sp>by<sp>" ) + ( item . getOwner ( ) . getUsername ( ) ) ) + "<sp>for<sp>principal<sp>" ) + ( principal . getUsername ( ) ) ) ) ; } if ( principal . getAdmin ( ) ) { return true ; } if ( privilege . equals ( DavPrivilege . READ_CURRENT_USER_PRIVILEGE_SET ) ) { return true ; } return item . getOwner ( ) . equals ( principal ) ; } | org . junit . Assert . assertTrue ( evaluater . evaluate ( calendar , filter ) ) |
testGetCurrentEvent ( ) { "<AssertPlaceHolder>" ; } getCurrentEvent ( ) { org . eclipse . tracecompass . internal . tmf . ctf . core . trace . iterator . CtfIterator iterator = getIterator ( ) ; return iterator == null ? null : iterator . getCurrentEvent ( ) ; } | org . junit . Assert . assertNotNull ( fixture . getCurrentEvent ( ) ) |
testDeleteAnnotationSet ( ) { catalogManager . getSampleManager ( ) . removeAnnotationSet ( studyFqn , s_1 , "annot1" , org . opencb . commons . datastore . core . QueryOptions . empty ( ) , sessionIdUser ) ; org . opencb . commons . datastore . core . QueryResult < org . opencb . opencga . catalog . managers . Sample > sampleQueryResult = catalogManager . getSampleManager ( ) . get ( studyFqn , s_1 , new org . opencb . commons . datastore . core . QueryOptions ( org . opencb . commons . datastore . core . QueryOptions . INCLUDE , SampleDBAdaptor . QueryParams . ANNOTATION_SETS . key ( ) ) , sessionIdUser ) ; "<AssertPlaceHolder>" ; } getAnnotationSets ( ) { return annotationSets ; } | org . junit . Assert . assertEquals ( 0 , sampleQueryResult . first ( ) . getAnnotationSets ( ) . size ( ) ) |
testIsJaninoAvailable_2 ( ) { boolean result = org . audit4j . core . util . EnvUtil . isJaninoAvailable ( ) ; "<AssertPlaceHolder>" ; } isJaninoAvailable ( ) { java . lang . ClassLoader classLoader = org . audit4j . core . util . EnvUtil . class . getClassLoader ( ) ; try { java . lang . Class < ? > bindingClass = classLoader . loadClass ( "org.codehaus.janino.ScriptEvaluator" ) ; return bindingClass != null ; } catch ( java . lang . ClassNotFoundException e ) { return false ; } } | org . junit . Assert . assertEquals ( false , result ) |
testElimina ( ) { mx . edu . um . mateo . general . model . Usuario usuario = obtieneUsuario ( ) ; mx . edu . um . mateo . contabilidad . facturas . model . ProveedorFacturas proveedorFacturas = new mx . edu . um . mateo . contabilidad . facturas . model . ProveedorFacturas ( "testA" , "TEST-01" , "nombre" , "appaterno" , "apmaterno" , "test@prv.edu.mx" , "TEST-01" , "TEST-01" , "TEST-01" , "TEST-01" , "TEST-01" , "TEST-01" , "TEST-01" , "TEST-01" , "TEST-01" , "a" , "TEST-01" ) ; proveedorFacturas . setAlmacen ( usuario . getAlmacen ( ) ) ; proveedorFacturas . setEmpresa ( usuario . getEmpresa ( ) ) ; currentSession ( ) . save ( proveedorFacturas ) ; "<AssertPlaceHolder>" ; this . authenticate ( proveedorFacturas , proveedorFacturas . getPassword ( ) , new java . util . ArrayList < org . springframework . security . core . GrantedAuthority > ( proveedorFacturas . getRoles ( ) ) ) ; this . mockMvc . perform ( post ( Constantes . PATH_PROVEEDORFACTURAS_ELIMINA ) . param ( "id" , proveedorFacturas . getId ( ) . toString ( ) ) ) . andExpect ( flash ( ) . attributeExists ( Constantes . CONTAINSKEY_MESSAGE ) ) . andExpect ( flash ( ) . attribute ( Constantes . CONTAINSKEY_MESSAGE , "proveedor.eliminado.message" ) ) . andExpect ( redirectedUrl ( Constantes . PATH_PROVEEDORFACTURAS_LISTA ) ) ; } getId ( ) { return id ; } | org . junit . Assert . assertNotNull ( proveedorFacturas . getId ( ) ) |
deveGerarXMLDeAcordoComOPadraoEstabelecido ( ) { final java . lang . String xmlEsperado = "<NFNotaInfoItemProduto><cProd>ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq</cProd><cEAN>36811963532505</cEAN><xProd>OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP</xProd><NCM>99999999</NCM><NVE>AZ0123</NVE><CEST>9999999</CEST><EXTIPI>999</EXTIPI><CFOP>1302</CFOP><uCom>Bta64y</uCom><qCom>9999999999.9999</qCom><vUnCom>9999999999.9999999999</vUnCom><vProd>999999999999.99</vProd><cEANTrib>36811963532505</cEANTrib><uTrib>7wqG4h</uTrib><qTrib>9999999999.9999</qTrib><vUnTrib>9999999999.9999999999</vUnTrib><vFrete>999999999999.99</vFrete><vSeg>999999999999.99</vSeg><vDesc>999999999999.99</vDesc><vOutro>999999999999.99</vOutro><indTot>1</indTot><DI><nDI>ZRJihqWLyHnb</nDI><dDI>2014-02-02</dDI><xLocDesemb>kiVfWKB94ggsrWND0XBXwEjJkoiTXhkmX9qKGKzjpnEHHp852bDkYeEUkzpU</xLocDesemb><UFDesemb>RS</UFDesemb><dDesemb>2014-01-01</dDesemb><tpViaTransp>4</tpViaTransp><vAFRMM>999999999999.99</vAFRMM><tpIntermedio>3</tpIntermedio><CNPJ>12345678901234</CNPJ><UFTerceiro>RS</UFTerceiro><cExportador>E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU</cExportador><adi><nAdicao>999</nAdicao><nSeqAdic>999</nSeqAdic><cFabricante>sA2FBRFMMNgF1AKRDDXYOlc3zGvzEc69l6zQ5O5uAUe82XZ3szQfw01DW0Ki</cFabricante><vDescDI>999999999999.99</vDescDI><nDraw>99999999999</nDraw></adi></DI><xPed>NNxQ9nrQ3HCe5Mc</xPed><nItemPed>999999</nItemPed><med><nLote>yq50jVDZsvQVNuWoS45U</nLote><qLote>9999999.999</qLote><dFab>2014-01-01</dFab><dVal>2015-01-01</dVal><vPMC>999999999999.99</vPMC></med></NFNotaInfoItemProduto>" ; "<AssertPlaceHolder>" ; } getNFNotaInfoItemProduto ( ) { final com . fincatto . documentofiscal . nfe310 . NFNotaInfoItemProduto produto = new com . fincatto . documentofiscal . nfe310 . NFNotaInfoItemProduto ( ) ; produto . setCfop ( "1302" ) ; produto . setCodigo ( "Bta64y" 1 ) ; produto . setCodigoDeBarras ( "36811963532505" ) ; produto . setCodigoDeBarrasTributavel ( "36811963532505" ) ; produto . setCampoeValorNota ( NFProdutoCompoeValorNota . SIM ) ; produto . setDeclaracoesImportacao ( java . util . Collections . singletonList ( com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItemProdutoDeclaracaoImportacao ( ) ) ) ; produto . setDescricao ( "Bta64y" 0 ) ; produto . setExtipi ( "999" ) ; produto . setCodigoEspecificadorSituacaoTributaria ( "Bta64y" 3 ) ; produto . setMedicamentos ( java . util . Collections . singletonList ( com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItemProdutoMedicamento ( ) ) ) ; produto . setNcm ( "99999999" ) ; produto . setNumeroPedidoCliente ( "NNxQ9nrQ3HCe5Mc" ) ; produto . setNumeroPedidoItemCliente ( 999999 ) ; produto . setQuantidadeComercial ( new java . math . BigDecimal ( "Bta64y" 2 ) ) ; produto . setQuantidadeTributavel ( new java . math . BigDecimal ( "Bta64y" 2 ) ) ; produto . setUnidadeComercial ( "Bta64y" ) ; produto . setUnidadeTributavel ( "7wqG4h" ) ; produto . setValorDesconto ( new java . math . BigDecimal ( "999999999999.99" ) ) ; produto . setValorFrete ( new java . math . BigDecimal ( "999999999999.99" ) ) ; produto . setValorOutrasDespesasAcessorias ( new java . math . BigDecimal ( "999999999999.99" ) ) ; produto . setValorSeguro ( new java . math . BigDecimal ( "999999999999.99" ) ) ; produto . setValorTotalBruto ( new java . math . BigDecimal ( "999999999999.99" ) ) ; produto . setValorUnitario ( new java . math . BigDecimal ( "9999999999.9999999999" ) ) ; produto . setNomeclaturaValorAduaneiroEstatistica ( java . util . Collections . singletonList ( "AZ0123" ) ) ; produto . setValorUnitarioTributavel ( new java . math . BigDecimal ( "9999999999.9999999999" ) ) ; return produto ; } | org . junit . Assert . assertEquals ( xmlEsperado , com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItemProduto ( ) . toString ( ) ) |
testNonExistentFieldInverted ( ) { rule . setInverted ( true ) ; msg . addField ( "someother" , "hello<sp>foo" ) ; org . graylog2 . streams . matchers . StreamRuleMatcher matcher = getMatcher ( rule ) ; "<AssertPlaceHolder>" ; } match ( org . graylog2 . plugin . Message , org . graylog2 . plugin . streams . StreamRule ) { java . lang . Double msgVal = getDouble ( msg . getField ( rule . getField ( ) ) ) ; if ( msgVal == null ) { return false ; } java . lang . Double ruleVal = getDouble ( rule . getValue ( ) ) ; if ( ruleVal == null ) { return false ; } return ( rule . getInverted ( ) ) ^ ( msgVal > ruleVal ) ; } | org . junit . Assert . assertTrue ( matcher . match ( msg , rule ) ) |
testQualifyAddressGroupComplex ( ) { edu . internet2 . middleware . changelogconsumer . googleapps . utils . AddressFormatter addressFormatter = new edu . internet2 . middleware . changelogconsumer . googleapps . utils . AddressFormatter ( ) ; addressFormatter . setGroupIdentifierExpression ( "crs-${groupPath.replace(\"abc1:\",<sp>\"\")}-test" ) . setDomain ( "test.edu" ) ; java . lang . String expected = "crs-abc2-test@test.edu" ; java . lang . String result = addressFormatter . qualifyGroupAddress ( "abc1:abc2" ) ; "<AssertPlaceHolder>" ; } qualifyGroupAddress ( java . lang . String ) { final org . apache . commons . jexl2 . JexlContext context = new org . apache . commons . jexl2 . MapContext ( ) ; context . set ( "groupPath" , group ) ; final java . lang . String mailbox = groupIdentifierExp . evaluate ( context ) . toString ( ) ; return java . lang . String . format ( "%s@%s" , mailbox . replace ( ":" , "-" ) . toLowerCase ( ) , this . domain ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
valideAfnemerindicatie ( ) { final nl . bzk . brp . model . internbericht . ProtocolleringOpdracht protocolleringOpdracht = maakProtocolleringOpdracht ( SoortDienst . MUTATIELEVERING_OP_BASIS_VAN_AFNEMERINDICATIE , null , datumAanvangMaterielePeriode , null , datumTijdAanvangFormelePeriode , datumTijdEindeFormelePeriode , null ) ; "<AssertPlaceHolder>" ; } isValide ( ) { boolean resultaat ; if ( ( levering ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "Levering<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( ( personen ) == null ) || ( personen . isEmpty ( ) ) ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "Personen<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( levering . getToegangLeveringsautorisatieId ( ) ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "ToegangAbonnementId<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( levering . getDienstId ( ) ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "DienstId<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( ( levering . getDatumTijdKlaarzettenLevering ( ) ) == null ) || ( levering . getDatumTijdKlaarzettenLevering ( ) . heeftGeenWaarde ( ) ) ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "DatumTijdKlaarzettenLevering<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( getSoortDienst ( ) ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "Soort<sp>dienst<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . SOORTDIENSTEN_MET_SOORT_SYNCHRONISATIE_VERPLICHT . contains ( getSoortDienst ( ) ) ) && ( ( ( levering . getSoortSynchronisatie ( ) ) == null ) || ( levering . getSoortSynchronisatie ( ) . heeftGeenWaarde ( ) ) ) ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "ToegangAbonnementId<sp>dient<sp>gevuld<sp>te<sp>zijn." 0 , getSoortDienst ( ) ) ; } else { switch ( soortDienst ) { case ATTENDERING : case MUTATIELEVERING_OP_BASIS_VAN_DOELBINDING : resultaat = isValideAttenderingOfMutatieLeveringDoelbinding ( ) ; break ; case GEEF_DETAILS_PERSOON : case GEEF_DETAILS_PERSOON_BULK : resultaat = isValideGeefDetailsPersoon ( getHistorievorm ( ) ) ; break ; case MUTATIELEVERING_OP_BASIS_VAN_AFNEMERINDICATIE : case PLAATSEN_AFNEMERINDICATIE : case VERWIJDEREN_AFNEMERINDICATIE : resultaat = isValideAfnemerindicatie ( ) ; break ; case SYNCHRONISATIE_PERSOON : resultaat = isValideSynchronisatiePersoon ( ) ; break ; case GEEF_MEDEBEWONERS_VAN_PERSOON : resultaat = isValideGeefMedebewonersVanPersoon ( ) ; break ; default : final java . lang . String foutmelding = "Voor<sp>deze<sp>catalogusoptie<sp>is<sp>geen<sp>protocollering<sp>validatie<sp>ingesteld:<sp>" + ( soortDienst ) ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . error ( foutmelding ) ; throw new java . lang . IllegalArgumentException ( foutmelding ) ; } if ( ! resultaat ) { nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( ( "De<sp>protocollering<sp>is<sp>niet<sp>valide<sp>voor<sp>de<sp>catalogusoptie:<sp>{},<sp>" + ( ( "datum<sp>materieel<sp>selectie:<sp>{},<sp>datum<sp>aanvang<sp>materiele<sp>periode:<sp>{},<sp>" + "datum<sp>einde<sp>materiele<sp>periode:<sp>{},<sp>datum<sp>tijd<sp>aanv<sp>form<sp>periode:<sp>{},<sp>" ) + "ToegangAbonnementId<sp>dient<sp>gevuld<sp>te<sp>zijn." 1 ) ) , soortDienst , levering . getDatumMaterieelSelectie ( ) , levering . getDatumAanvangMaterielePeriodeResultaat ( ) , levering . getDatumEindeMaterielePeriodeResultaat ( ) , levering . getDatumTijdAanvangFormelePeriodeResultaat ( ) , levering . getDatumTijdEindeFormelePeriodeResultaat ( ) , historievorm ) ; } } return resultaat ; } | org . junit . Assert . assertTrue ( protocolleringOpdracht . isValide ( ) ) |
shouldReturnNullIfTheInputIsNull ( ) { final uk . gov . gchq . gaffer . data . element . id . ElementId input = null ; final uk . gov . gchq . gaffer . operation . function . FromElementId function = new uk . gov . gchq . gaffer . operation . function . FromElementId ( ) ; final java . lang . Object output = function . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Object ) { if ( null == value ) { return null ; } if ( value instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( value ) ) . intValue ( ) ; } if ( value instanceof java . lang . String ) { return java . lang . Integer . valueOf ( ( ( java . lang . String ) ( value ) ) ) ; } throw new java . lang . IllegalArgumentException ( ( "Could<sp>not<sp>convert<sp>value<sp>to<sp>Integer:<sp>" + value ) ) ; } | org . junit . Assert . assertNull ( output ) |
testColumnProperties ( ) { java . lang . String ddl = ( ( ( ( ( ( ( ( ( ( ( ( ( "CREATE<sp>VIEW<sp>StockPrices<sp>(" + ( NEW_LINE ) ) + "symbol<sp>string(10)<sp>NOT<sp>NULL<sp>AUTO_INCREMENT,<sp>" ) + ( NEW_LINE ) ) + "companyID<sp>string(10)<sp>NOT<sp>NULL," 1 ) + ( NEW_LINE ) ) + "companyID<sp>string(10)<sp>NOT<sp>NULL," 2 ) + ( NEW_LINE ) ) + "companyID<sp>string(10)<sp>NOT<sp>NULL," ) + ( NEW_LINE ) ) + "CONSTRAINT<sp>STOCK_PK<sp>PRIMARY<sp>KEY(symbol)," ) + ( NEW_LINE ) ) + "CONSTRAINT<sp>STOCK_UC<sp>UNIQUE(company)" ) + ( NEW_LINE ) ) + "companyID<sp>string(10)<sp>NOT<sp>NULL," 0 ; java . lang . String expectedDdl = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "CREATE<sp>VIEW<sp>StockPrices<sp>(" + "symbol<sp>string(10)<sp>NOT<sp>NULL<sp>AUTO_INCREMENT" ) + ( COMMA ) ) + ( SPACE ) ) + "price<sp>bigdecimal(1)<sp>DEFAULT<sp>'10'" ) + ( COMMA ) ) + ( SPACE ) ) + "company<sp>string(10)<sp>NOT<sp>NULL" ) + ( COMMA ) ) + ( SPACE ) ) + "companyID<sp>string(10)<sp>NOT<sp>NULL" ) + ( COMMA ) ) + ( SPACE ) ) + "CONSTRAINT<sp>STOCK_PK<sp>PRIMARY<sp>KEY(symbol)" ) + ( COMMA ) ) + ( SPACE ) ) + "CONSTRAINT<sp>STOCK_UC<sp>UNIQUE(company)" ) + "companyID<sp>string(10)<sp>NOT<sp>NULL," 0 ; java . lang . String generatedDdl = roundTrip ( ddl , true ) ; "<AssertPlaceHolder>" ; } roundTrip ( java . lang . String , boolean ) { org . teiid . designer . core . workspace . ModelResource modelResource = createModelResource ( ddl , isVirtual ) ; java . lang . String generatedDdl = generator . generate ( modelResource ) ; generatedDdl = removeWhitespace ( generatedDdl ) ; return generatedDdl ; } | org . junit . Assert . assertEquals ( expectedDdl , generatedDdl ) |
testIPv6AddressMatchesIPv6Address ( ) { com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidator allowedIPAddressesValidator = com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidatorFactory . create ( com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidatorTest . _ADDRESS_IP_V6 ) ; "<AssertPlaceHolder>" ; } isAllowedIPAddress ( java . lang . String ) { java . net . InetAddress inetAddress = null ; try { inetAddress = com . liferay . portal . kernel . util . InetAddressUtil . getInetAddressByName ( ipAddress ) ; } catch ( java . net . UnknownHostException uhe ) { return false ; } byte [ ] inetAddressBytes = inetAddress . getAddress ( ) ; if ( ! ( isSameProtocol ( inetAddressBytes ) ) ) { return false ; } if ( ( _netmask ) == null ) { return _allowedIpAddress . equals ( inetAddress ) ; } for ( int i = 0 ; i < ( _netmask . length ) ; i ++ ) { if ( ( ( inetAddressBytes [ i ] ) & ( _netmask [ i ] ) ) != ( ( _allowedIpAddressBytes [ i ] ) & ( _netmask [ i ] ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertTrue ( allowedIPAddressesValidator . isAllowedIPAddress ( com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidatorTest . _ADDRESS_IP_V6 ) ) |
testUnsupportedType ( ) { testMetadata . setContentType ( "fake/type" ) ; org . sagebionetworks . repo . model . file . PreviewFileHandle pfm = previewManager . generatePreview ( testMetadata ) ; "<AssertPlaceHolder>" ; } generatePreview ( org . sagebionetworks . repo . model . file . S3FileHandle ) { if ( metadata == null ) throw new java . lang . IllegalArgumentException ( "metadata<sp>cannot<sp>be<sp>null" ) ; if ( ( metadata . getContentType ( ) ) == null ) throw new java . lang . IllegalArgumentException ( "metadata.getContentType()<sp>cannot<sp>be<sp>null" ) ; if ( ( metadata . getContentSize ( ) ) == null ) throw new java . lang . IllegalArgumentException ( "metadata.getContentSize()<sp>cannot<sp>be<sp>null" ) ; if ( ( metadata . getContentSize ( ) ) == 0L ) { org . sagebionetworks . repo . manager . file . preview . PreviewManagerImpl . log . info ( "Cannot<sp>generate<sp>preview<sp>of<sp>empty<sp>file" ) ; return null ; } if ( org . apache . commons . lang3 . StringUtils . isEmpty ( metadata . getContentType ( ) ) ) { org . sagebionetworks . repo . manager . file . preview . PreviewManagerImpl . log . info ( "Cannot<sp>generate<sp>preview<sp>for<sp>file<sp>with<sp>empty<sp>content<sp>type" ) ; return null ; } org . apache . http . entity . ContentType contentType = org . apache . http . entity . ContentType . parse ( metadata . getContentType ( ) ) ; java . lang . String extension = org . sagebionetworks . repo . manager . file . preview . PreviewGeneratorUtils . findExtension ( metadata . getFileName ( ) ) ; final org . sagebionetworks . repo . manager . file . preview . PreviewGenerator generator = findPreviewGenerator ( contentType . getMimeType ( ) , extension ) ; if ( generator == null ) { org . sagebionetworks . repo . manager . file . preview . PreviewManagerImpl . log . info ( ( "No<sp>preview<sp>generator<sp>found<sp>for<sp>contentType:" + ( metadata . getContentType ( ) ) ) ) ; return null ; } java . lang . String mimeType = org . apache . http . entity . ContentType . parse ( metadata . getContentType ( ) ) . getMimeType ( ) ; long memoryNeededBytes = generator . calculateNeededMemoryBytesForPreview ( mimeType , metadata . getContentSize ( ) ) ; if ( memoryNeededBytes > ( maxPreviewMemory ) ) { org . sagebionetworks . repo . manager . file . preview . PreviewManagerImpl . log . info ( java . lang . String . format ( "Preview<sp>cannot<sp>be<sp>generated.<sp>Memory<sp>needed:<sp>'%1$s'<sp>(bytes)<sp>exceed<sp>preview<sp>memory<sp>pool<sp>size:<sp>'%2$s'<sp>(bytes).<sp>Metadata:<sp>%3$s" , memoryNeededBytes , maxPreviewMemory , metadata . toString ( ) ) ) ; return null ; } try { return resourceTracker . allocateAndUseResources ( new java . util . concurrent . Callable < org . sagebionetworks . repo . model . file . PreviewFileHandle > ( ) { @ org . sagebionetworks . repo . manager . file . preview . Override public org . sagebionetworks . repo . model . file . PreviewFileHandle call ( ) { return generatePreview ( generator , metadata ) ; } } , memoryNeededBytes ) ; } catch ( org . sagebionetworks . repo . web . TemporarilyUnavailableException temp ) { org . sagebionetworks . repo . manager . file . preview . PreviewManagerImpl . log . info ( ( "There<sp>is<sp>not<sp>enough<sp>memory<sp>to<sp>at<sp>this<sp>time<sp>to<sp>create<sp>a<sp>preview<sp>for<sp>this<sp>file.<sp>It<sp>will<sp>be<sp>placed<sp>back<sp>on<sp>the<sp>queue<sp>and<sp>retried<sp>at<sp>a<sp>later<sp>time.<sp>S3FileMetadata:<sp>" + metadata ) ) ; throw temp ; } catch ( org . sagebionetworks . repo . util . ResourceTracker . ExceedsMaximumResources e ) { org . sagebionetworks . repo . manager . file . preview . PreviewManagerImpl . log . info ( java . lang . String . format ( "Preview<sp>cannot<sp>be<sp>generated.<sp>Memory<sp>needed:<sp>'%1$s'<sp>(bytes)<sp>exceed<sp>preview<sp>memory<sp>pool<sp>size:<sp>'%2$s'<sp>(bytes).<sp>Metadata:<sp>%3$s" , memoryNeededBytes , maxPreviewMemory , metadata . toString ( ) ) ) ; return null ; } } | org . junit . Assert . assertTrue ( ( pfm == null ) ) |
testValidate_2 ( ) { java . lang . String ip = "" ; boolean result = com . impetus . ankush . common . utils . validator . IPAddressValidator . validate ( ip ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . String ) { com . impetus . ankush . common . utils . validator . IPAddressValidator . pattern = java . util . regex . Pattern . compile ( com . impetus . ankush . common . utils . validator . IPAddressValidator . IPADDRESS_PATTERN ) ; com . impetus . ankush . common . utils . validator . IPAddressValidator . matcher = com . impetus . ankush . common . utils . validator . IPAddressValidator . pattern . matcher ( ip ) ; return com . impetus . ankush . common . utils . validator . IPAddressValidator . matcher . matches ( ) ; } | org . junit . Assert . assertEquals ( false , result ) |
coercePath ( ) { java . lang . String path = "hello.a" ; projectFilesystem . touch ( java . nio . file . Paths . get ( path ) ) ; com . facebook . buck . core . sourcepath . SourcePath sourcePath = sourcePathTypeCoercer . coerce ( cellRoots , projectFilesystem , pathRelativeToProjectRoot , EmptyTargetConfiguration . INSTANCE , path ) ; "<AssertPlaceHolder>" ; } of ( com . facebook . buck . io . filesystem . ProjectFilesystem , java . nio . file . Path ) { return com . facebook . buck . core . sourcepath . PathSourcePath . of ( filesystem , path ) ; } | org . junit . Assert . assertEquals ( com . facebook . buck . core . sourcepath . PathSourcePath . of ( projectFilesystem , java . nio . file . Paths . get ( path ) ) , sourcePath ) |
testSetTag_Long ( ) { co . nstant . in . cbor . model . DataItem di = new co . nstant . in . cbor . model . DataItem ( MajorType . UNSIGNED_INTEGER ) ; di . setTag ( 1 ) ; "<AssertPlaceHolder>" ; } getTag ( ) { return tag ; } | org . junit . Assert . assertNotNull ( di . getTag ( ) ) |
testSerialization ( ) { double [ ] starts_S1 = new double [ ] { 0.1 , 0.2 , 0.3 } ; double [ ] starts_S2 = new double [ ] { 0.3 , 0.4 , 0.5 } ; double [ ] ends_S1 = new double [ ] { 0.5 , 0.6 , 0.7 } ; double [ ] ends_S2 = new double [ ] { 0.7 , 0.8 , 0.9 } ; double [ ] [ ] starts = new double [ ] [ ] { starts_S1 , starts_S2 } ; double [ ] [ ] ends = new double [ ] [ ] { ends_S1 , ends_S2 } ; org . jfree . data . category . DefaultIntervalCategoryDataset d1 = new org . jfree . data . category . DefaultIntervalCategoryDataset ( starts , ends ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( d1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . data . category . DefaultIntervalCategoryDataset d2 = ( ( org . jfree . data . category . DefaultIntervalCategoryDataset ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } } | org . junit . Assert . assertEquals ( d1 , d2 ) |
testAbstractHandler_InterledgerPayment ( ) { final org . interledger . ilp . InterledgerPayment interledgerPayment = mock ( org . interledger . ilp . InterledgerPayment . class ) ; final org . interledger . ilqp . QuoteLiquidityRequest quoteLiquidityRequest = mock ( org . interledger . ilqp . QuoteLiquidityRequest . class ) ; final org . interledger . ilqp . QuoteLiquidityResponse quoteLiquidityResponse = mock ( org . interledger . ilqp . QuoteLiquidityResponse . class ) ; final java . lang . String actual = new org . interledger . InterledgerPacketHandlerTest . TestAbstractHandler ( ) . execute ( interledgerPayment ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( interledgerPayment ) . getDestinationAmount ( ) ; org . mockito . Mockito . verifyNoMoreInteractions ( quoteLiquidityRequest ) ; org . mockito . Mockito . verifyNoMoreInteractions ( quoteLiquidityResponse ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . core . Is . is ( "a" ) ) |
testSetUserRolesEmptyList ( ) { container . login ( operatorKey , org . oscm . identityservice . bean . ROLE_ORGANIZATION_ADMIN ) ; org . oscm . internal . vo . VOUserDetails user = new org . oscm . internal . vo . VOUserDetails ( ) ; user . setUserId ( org . oscm . identityservice . bean . IdentityServiceBeanIT . USER_ID_EXISTING_OP_USER ) ; user . setOrganizationId ( po . getOrganizationId ( ) ) ; final org . oscm . internal . vo . VOUser voUser = idMgmt . getUser ( user ) ; java . util . List < org . oscm . internal . types . enumtypes . UserRoleType > roleList = new java . util . ArrayList ( ) ; idMgmt . setUserRoles ( voUser , roleList ) ; final org . oscm . domobjects . PlatformUser pUser = new org . oscm . domobjects . PlatformUser ( ) ; pUser . setUserId ( voUser . getUserId ( ) ) ; org . oscm . domobjects . PlatformUser resultUser = null ; resultUser = runTX ( new java . util . concurrent . Callable < org . oscm . domobjects . PlatformUser > ( ) { @ org . oscm . identityservice . bean . Override public org . oscm . domobjects . PlatformUser call ( ) { org . oscm . domobjects . PlatformUser resultUser = mgr . find ( org . oscm . domobjects . PlatformUser . class , voUser . getKey ( ) ) ; load ( resultUser ) ; return resultUser ; } } ) ; "<AssertPlaceHolder>" ; } getAssignedRoles ( ) { return assignedRoles ; } | org . junit . Assert . assertTrue ( resultUser . getAssignedRoles ( ) . isEmpty ( ) ) |
testGetSdkFromBuckconfig ( ) { java . nio . file . Path sdkDir = tmpDir . newFolder ( "sdk" ) ; com . facebook . buck . android . toolchain . impl . AndroidSdkDirectoryResolver resolver = new com . facebook . buck . android . toolchain . impl . AndroidSdkDirectoryResolver ( tmpDir . getRoot ( ) . getFileSystem ( ) , com . google . common . collect . ImmutableMap . of ( ) , com . facebook . buck . android . FakeAndroidBuckConfig . builder ( ) . setSdkPath ( sdkDir . toString ( ) ) . build ( ) ) ; "<AssertPlaceHolder>" ; } getSdkOrThrow ( ) { if ( ( ! ( sdk . isPresent ( ) ) ) && ( sdkErrorMessage . isPresent ( ) ) ) { throw new com . facebook . buck . core . exceptions . HumanReadableException ( sdkErrorMessage . get ( ) ) ; } return sdk . get ( ) ; } | org . junit . Assert . assertEquals ( sdkDir , resolver . getSdkOrThrow ( ) ) |
testElConstant ( ) { com . streamsets . pipeline . api . el . ELEval elEval = new com . streamsets . datacollector . el . ELEvaluator ( "testElConstant" , false , elDefinitionExtractor , com . streamsets . datacollector . el . TestELEvaluator . ValidTestEl . class ) ; com . streamsets . pipeline . api . el . ELVars variables = elEval . createVariables ( ) ; java . lang . Boolean result = elEval . eval ( variables , "${CITY<sp>eq<sp>\"San<sp>Francisco\"}" , com . streamsets . datacollector . el . Boolean . class ) ; "<AssertPlaceHolder>" ; } createVariables ( ) { return new com . streamsets . datacollector . el . ELVariables ( constants ) ; } | org . junit . Assert . assertTrue ( result ) |
testPropertySetAfterAdapterCreationShouldBeTakenIntoAccount ( ) { com . picocontainer . behaviors . PropertyApplying factory = ( ( com . picocontainer . behaviors . PropertyApplying ) ( createComponentFactory ( ) ) ) ; com . picocontainer . behaviors . PropertyApplying . PropertyApplicator adapter = ( ( com . picocontainer . behaviors . PropertyApplying . PropertyApplicator ) ( factory . createComponentAdapter ( new com . picocontainer . monitors . NullComponentMonitor ( ) , new com . picocontainer . lifecycle . NullLifecycleStrategy ( ) , new java . util . Properties ( com . picocontainer . Characteristics . CDI ) , "foo" , com . picocontainer . behaviors . PropertyApplyingTestCase . Foo . class , null , null , null ) ) ) ; adapter . setProperty ( "message" , "hello" ) ; com . picocontainer . behaviors . PropertyApplyingTestCase . Foo foo = ( ( com . picocontainer . behaviors . PropertyApplyingTestCase . Foo ) ( adapter . getComponentInstance ( null , ComponentAdapter . NOTHING . class ) ) ) ; "<AssertPlaceHolder>" ; } getComponentInstance ( com . picocontainer . PicoContainer , java . lang . reflect . Type ) { return null ; } | org . junit . Assert . assertEquals ( "hello" , foo . message ) |
testThrowCheckedException ( ) { java . io . IOException expected = new java . io . IOException ( "EXPECTED<sp>ERROR" ) ; java . io . IOException actual = null ; try { org . slieb . throwables . LongToDoubleFunctionWithThrowable . aLongToDoubleFunctionThatUnsafelyThrowsUnchecked ( ( v1 ) -> { throw expected ; } ) . applyAsDouble ( 0 ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . io . IOException e ) { actual = e ; } "<AssertPlaceHolder>" ; } applyAsDouble ( T ) { try { return applyAsDoubleWithThrowable ( v1 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
get_table_objects_by_name_req ( ) { com . hotels . bdp . waggledance . client . CloseableThriftHiveMetastoreIface thriftHiveMetastoreIface = factory . newInstance ( delegate ) ; org . apache . hadoop . hive . metastore . api . GetTablesRequest tablesRequest = new org . apache . hadoop . hive . metastore . api . GetTablesRequest ( com . hotels . bdp . waggledance . client . compatibility . HiveCompatibleThriftHiveMetastoreIfaceFactoryTest . DB_NAME ) ; tablesRequest . addToTblNames ( com . hotels . bdp . waggledance . client . compatibility . HiveCompatibleThriftHiveMetastoreIfaceFactoryTest . TABLE_NAME ) ; when ( delegate . get_table_objects_by_name_req ( tablesRequest ) ) . thenThrow ( new org . apache . thrift . TApplicationException ( "Error" ) ) ; when ( delegate . get_table_objects_by_name ( com . hotels . bdp . waggledance . client . compatibility . HiveCompatibleThriftHiveMetastoreIfaceFactoryTest . DB_NAME , com . google . common . collect . Lists . newArrayList ( com . hotels . bdp . waggledance . client . compatibility . HiveCompatibleThriftHiveMetastoreIfaceFactoryTest . TABLE_NAME ) ) ) . thenReturn ( com . google . common . collect . Lists . newArrayList ( table ) ) ; org . apache . hadoop . hive . metastore . api . GetTablesResult tablesResult = thriftHiveMetastoreIface . get_table_objects_by_name_req ( tablesRequest ) ; "<AssertPlaceHolder>" ; } get_table_objects_by_name_req ( org . apache . hadoop . hive . metastore . api . GetTablesRequest ) { java . util . List < org . apache . hadoop . hive . metastore . api . Table > tables = client . get_table_objects_by_name ( req . getDbName ( ) , req . getTblNames ( ) ) ; return new org . apache . hadoop . hive . metastore . api . GetTablesResult ( tables ) ; } | org . junit . Assert . assertThat ( tablesResult , org . hamcrest . CoreMatchers . is ( new org . apache . hadoop . hive . metastore . api . GetTablesResult ( com . google . common . collect . Lists . newArrayList ( table ) ) ) ) |
testQuotaByStorageTypeParentOffChildOff ( ) { final org . apache . hadoop . fs . Path parent = new org . apache . hadoop . fs . Path ( org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . dir , "parent" ) ; final org . apache . hadoop . fs . Path child = new org . apache . hadoop . fs . Path ( parent , "child" ) ; dfs . mkdirs ( parent ) ; dfs . mkdirs ( child ) ; dfs . setStoragePolicy ( parent , HdfsConstants . ONESSD_STORAGE_POLICY_NAME ) ; org . apache . hadoop . fs . Path createdFile1 = new org . apache . hadoop . fs . Path ( child , "created_file1.data" ) ; long file1Len = ( ( org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . BLOCKSIZE ) * 2 ) + ( ( org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . BLOCKSIZE ) / 2 ) ; int bufLen = ( org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . BLOCKSIZE ) / 16 ; org . apache . hadoop . hdfs . DFSTestUtil . createFile ( dfs , createdFile1 , bufLen , file1Len , org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . BLOCKSIZE , org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . REPLICATION , org . apache . hadoop . hdfs . server . namenode . TestQuotaByStorageType . seed ) ; java . lang . Thread . sleep ( 5000 ) ; long ssdConsumed = getSpaceConsumed ( new org . apache . hadoop . fs . Path ( "/" ) ) . getTypeSpaces ( ) . get ( StorageType . SSD ) ; "<AssertPlaceHolder>" ; } get ( K extends org . apache . hadoop . yarn . server . timeline . EntityIdentifier ) { V result = null ; byte [ ] startTimeBytes = entityDb . get ( getStartTimeKey ( entityId ) ) ; if ( startTimeBytes == null ) { return null ; } try { result = getEntityForKey ( getEntityKey ( entityId , startTimeBytes ) ) ; } catch ( java . io . IOException e ) { org . apache . hadoop . yarn . server . timeline . LevelDBCacheTimelineStore . LOG . error ( ( ( "GenericObjectMapper<sp>cannot<sp>read<sp>key<sp>from<sp>key<sp>" + ( entityId . toString ( ) ) ) + "<sp>into<sp>an<sp>object.<sp>Read<sp>aborted!<sp>" ) ) ; org . apache . hadoop . yarn . server . timeline . LevelDBCacheTimelineStore . LOG . error ( e . getMessage ( ) ) ; } return result ; } | org . junit . Assert . assertEquals ( file1Len , ssdConsumed ) |
testJsonWithoutPadding ( ) { org . apache . cxf . message . Message message = new org . apache . cxf . message . MessageImpl ( ) ; message . put ( Message . CONTENT_TYPE , MediaType . APPLICATION_JSON ) ; message . setExchange ( new org . apache . cxf . message . ExchangeImpl ( ) ) ; java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; message . setContent ( java . io . OutputStream . class , bos ) ; in . handleMessage ( message ) ; preStream . handleMessage ( message ) ; postStream . handleMessage ( message ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( 128 ) ; builder . append ( "ProcessedClaim<sp>[" ) ; builder . append ( super . toString ( ) ) ; builder . append ( ",<sp>issuer=" ) ; builder . append ( issuer ) ; builder . append ( ",<sp>originalIssuer=" ) ; builder . append ( originalIssuer ) ; builder . append ( ",<sp>principal=" ) ; builder . append ( principal ) ; builder . append ( ']' ) ; return builder . toString ( ) ; } | org . junit . Assert . assertEquals ( "" , bos . toString ( ) ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . marketplace . model . App newApp = addApp ( ) ; com . liferay . marketplace . model . App existingApp = _persistence . findByPrimaryKey ( newApp . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingApp , newApp ) |
testSaveAndRetrieve ( ) { java . util . Random r = new java . util . Random ( 1234 ) ; org . apache . hadoop . hive . ql . exec . vector . TimestampColumnVector timestampColVector = new org . apache . hadoop . hive . ql . exec . vector . TimestampColumnVector ( ) ; java . sql . Timestamp [ ] randTimestamps = new java . sql . Timestamp [ VectorizedRowBatch . DEFAULT_SIZE ] ; for ( int i = 0 ; i < ( VectorizedRowBatch . DEFAULT_SIZE ) ; i ++ ) { java . sql . Timestamp randTimestamp = org . apache . hadoop . hive . common . type . RandomTypeUtil . getRandTimestamp ( r ) ; randTimestamps [ i ] = randTimestamp ; timestampColVector . set ( i , randTimestamp ) ; } for ( int i = 0 ; i < ( VectorizedRowBatch . DEFAULT_SIZE ) ; i ++ ) { java . sql . Timestamp retrievedTimestamp = timestampColVector . asScratchTimestamp ( i ) ; java . sql . Timestamp randTimestamp = randTimestamps [ i ] ; if ( ! ( retrievedTimestamp . equals ( randTimestamp ) ) ) { "<AssertPlaceHolder>" ; } } } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; org . apache . hadoop . hive . metastore . HiveClientCache . HiveClientCacheKey that = ( ( org . apache . hadoop . hive . metastore . HiveClientCache . HiveClientCacheKey ) ( o ) ) ; return new org . apache . commons . lang . builder . EqualsBuilder ( ) . append ( this . metaStoreURIs , that . metaStoreURIs ) . append ( this . ugi , that . ugi ) . append ( this . threadId , that . threadId ) . isEquals ( ) ; } | org . junit . Assert . assertTrue ( false ) |
testToArray ( ) { com . gs . collections . impl . set . mutable . primitive . ByteHashSet hashSet = com . gs . collections . impl . set . mutable . primitive . ByteHashSet . newSetWith ( ) ; hashSet . add ( ( ( byte ) ( 0 ) ) ) ; hashSet . add ( ( ( byte ) ( 1 ) ) ) ; hashSet . add ( ( ( byte ) ( 2 ) ) ) ; hashSet . add ( ( ( byte ) ( 20 ) ) ) ; hashSet . add ( ( ( byte ) ( 55 ) ) ) ; hashSet . add ( ( ( byte ) ( 63 ) ) ) ; hashSet . add ( ( ( byte ) ( 64 ) ) ) ; hashSet . add ( ( ( byte ) ( 65 ) ) ) ; hashSet . add ( ( ( byte ) ( 67 ) ) ) ; hashSet . add ( ( ( byte ) ( 70 ) ) ) ; hashSet . add ( ( ( byte ) ( 78 ) ) ) ; hashSet . add ( ( ( byte ) ( 80 ) ) ) ; hashSet . add ( ( ( byte ) ( 87 ) ) ) ; hashSet . add ( ( ( byte ) ( 98 ) ) ) ; hashSet . add ( ( ( byte ) ( 127 ) ) ) ; hashSet . add ( ( ( byte ) ( - 1 ) ) ) ; hashSet . add ( ( ( byte ) ( - 5 ) ) ) ; hashSet . add ( ( ( byte ) ( - 14 ) ) ) ; hashSet . add ( ( ( byte ) ( - 56 ) ) ) ; hashSet . add ( ( ( byte ) ( - 63 ) ) ) ; hashSet . add ( ( ( byte ) ( - 64 ) ) ) ; hashSet . add ( ( ( byte ) ( - 65 ) ) ) ; hashSet . add ( ( ( byte ) ( - 67 ) ) ) ; hashSet . add ( ( ( byte ) ( - 100 ) ) ) ; hashSet . add ( ( ( byte ) ( - 98 ) ) ) ; hashSet . add ( ( ( byte ) ( - 87 ) ) ) ; hashSet . add ( ( ( byte ) ( - 128 ) ) ) ; byte [ ] expected = new byte [ ] { - 128 , - 100 , - 98 , - 87 , - 67 , - 65 , - 64 , - 63 , - 56 , - 14 , - 5 , - 1 , 0 , 1 , 2 , 20 , 55 , 63 , 64 , 65 , 67 , 70 , 78 , 80 , 87 , 98 , 127 } ; "<AssertPlaceHolder>" ; } toArray ( ) { return new java . lang . Object [ 0 ] ; } | org . junit . Assert . assertArrayEquals ( expected , hashSet . toArray ( ) ) |
testNoSuchProduct ( ) { final net . violet . platform . datamodel . Lang frLang = getSiteFrLang ( ) ; final net . violet . platform . api . actions . Action theAction = new net . violet . platform . api . actions . press . GetPressClip ( ) ; final net . violet . platform . api . callers . APICaller caller = getPublicApplicationAPICaller ( ) ; final java . util . Map < java . lang . String , java . lang . Object > theParams = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; theParams . put ( "language" , frLang . getIsoCode ( ) ) ; theParams . put ( "product" , "inexisting<sp>product<sp>!" ) ; final net . violet . platform . api . actions . ActionParam theActionParam = new net . violet . platform . api . actions . ActionParam ( caller , theParams ) ; final java . lang . Object theResult = theAction . processRequest ( theActionParam ) ; "<AssertPlaceHolder>" ; } put ( K , T ) { this . mMap . put ( theRef , new net . violet . db . cache . CacheReference < K , T > ( theRef , theRecord , this . mReferenceQueue ) ) ; this . mLinkedMap . put ( theRef , theRecord ) ; } | org . junit . Assert . assertNotNull ( theResult ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . Team newTeam = addTeam ( ) ; com . liferay . portal . kernel . model . Team existingTeam = _persistence . findByPrimaryKey ( newTeam . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingTeam , newTeam ) |
testProjectWithSourceFolders ( ) { org . eclipse . jdt . core . IPackageFragmentRoot rootSrc1 = javaProject1 . createSourceFolder ( "src" ) ; org . eclipse . jdt . core . IPackageFragmentRoot rootSrc2 = javaProject1 . createSourceFolder ( "test" ) ; com . mountainminds . eclemma . core . JavaProjectKit . waitForBuild ( ) ; org . eclipse . debug . core . ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType ( ) . newInstance ( javaProject1 . project , "test.launch" ) ; configuration . setAttribute ( IJavaLaunchConfigurationConstants . ATTR_PROJECT_NAME , "project1" ) ; final java . util . Collection < org . eclipse . jdt . core . IPackageFragmentRoot > scope = launcher . getOverallScope ( configuration ) ; "<AssertPlaceHolder>" ; } set ( E [ ] ) { return new java . util . HashSet < E > ( java . util . Arrays . asList ( elements ) ) ; } | org . junit . Assert . assertEquals ( set ( rootSrc1 , rootSrc2 ) , set ( scope ) ) |
testPrivateConstructor ( ) { java . lang . reflect . Constructor < org . terasoluna . gfw . web . util . RequestUtils > c = org . terasoluna . gfw . web . util . RequestUtils . class . getDeclaredConstructor ( ) ; c . setAccessible ( true ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( c . newInstance ( ) ) |
testSelectForUpdateFieldsQuery ( ) { final java . lang . String selectForUpdateQuery = getDialect ( ) . createSelectForUpdateQuery ( "MOVIE" , "ID,<sp>TITLE" , "ID" ) ; "<AssertPlaceHolder>" ; } getExpectedSelectForUpdateFieldsQuery ( ) { return "<sp>select<sp>ID,<sp>TITLE<sp>from<sp>MOVIE<sp>where<sp>ID<sp>=<sp>#ID#<sp>for<sp>update<sp>" ; } | org . junit . Assert . assertEquals ( getExpectedSelectForUpdateFieldsQuery ( ) , selectForUpdateQuery ) |
testOr ( ) { de . persosim . simulator . utils . BitField expected = new de . persosim . simulator . utils . BitField ( 20 , new byte [ ] { ( ( byte ) ( 255 ) ) , ( ( byte ) ( 255 ) ) , ( ( byte ) ( 255 ) ) , ( ( byte ) ( 240 ) ) } ) ; de . persosim . simulator . utils . BitField result = field1 . or ( field2 ) ; "<AssertPlaceHolder>" ; } or ( de . persosim . simulator . utils . BitField ) { boolean [ ] result = new boolean [ java . lang . Math . max ( getNumberOfBits ( ) , field . getNumberOfBits ( ) ) ] ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { result [ i ] = ( getZeroPaddedBit ( i ) ) | ( field . getZeroPaddedBit ( i ) ) ; } return new de . persosim . simulator . utils . BitField ( result ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
initialNodeNotHaveAnyIncomingActivityEdge ( ) { org . eclipse . uml2 . uml . InitialNode node = UMLFactory . eINSTANCE . createInitialNode ( ) ; "<AssertPlaceHolder>" ; } isValidActivityEdgeEnd ( org . eclipse . uml2 . uml . Element , org . eclipse . uml2 . uml . Element ) { return isValidFlowEnd ( source , preTarget ) ; } | org . junit . Assert . assertFalse ( services . isValidActivityEdgeEnd ( null , node ) ) |
test_updateIndexFile_nonXml ( ) { java . io . File txtFile = new java . io . File ( tmpFolder , "abc.txt" ) ; txtFile . createNewFile ( ) ; final boolean added = new org . talend . updates . runtime . nexus . component . ComponentIndexManager ( ) . updateIndexFile ( txtFile , null ) ; "<AssertPlaceHolder>" ; } updateIndexFile ( java . io . File , org . talend . updates . runtime . nexus . component . ComponentIndexBean ) { if ( ( ( ( ( indexBean == null ) || ( indexFile == null ) ) || ( ! ( indexFile . exists ( ) ) ) ) || ( indexFile . isDirectory ( ) ) ) || ( ! ( indexFile . getName ( ) . endsWith ( FileExtensions . XML_FILE_SUFFIX ) ) ) ) { return false ; } try { final java . util . List < org . talend . updates . runtime . nexus . component . ComponentIndexBean > existedIndexBeans = parse ( new org . dom4j . io . SAXReader ( ) . read ( indexFile ) ) ; java . util . List < org . talend . updates . runtime . nexus . component . ComponentIndexBean > newIndexList = new java . util . ArrayList < org . talend . updates . runtime . nexus . component . ComponentIndexBean > ( existedIndexBeans ) ; if ( newIndexList . contains ( indexBean ) ) { newIndexList . remove ( indexBean ) ; } newIndexList . add ( indexBean ) ; return createIndexFile ( indexFile , newIndexList ) ; } catch ( java . lang . Exception e ) { if ( org . talend . commons . CommonsPlugin . isDebugMode ( ) ) { org . talend . commons . exception . ExceptionHandler . process ( e ) ; } } return false ; } | org . junit . Assert . assertFalse ( added ) |
testDetectorWhenMetricsOutOfRange ( ) { when ( context . measurements ( ) ) . thenReturn ( com . microsoft . dhalion . core . MeasurementsTable . of ( metrics2 ) ) ; detector = new com . microsoft . dhalion . detectors . ExcessMemoryDetector ( policyConf ) ; detector . initialize ( context ) ; java . util . Collection < com . microsoft . dhalion . core . Symptom > symptoms = detector . detect ( metrics ) ; com . microsoft . dhalion . core . SymptomsTable symptomsTable = com . microsoft . dhalion . core . SymptomsTable . of ( symptoms ) ; "<AssertPlaceHolder>" ; } size ( ) { return table . rowCount ( ) ; } | org . junit . Assert . assertEquals ( 0 , symptomsTable . size ( ) ) |
testSetBeforeAndGetAfterDeprecation ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( "oldkey" , "hello" ) ; org . apache . hadoop . conf . Configuration . addDeprecation ( "oldkey" , new java . lang . String [ ] { "newkey" } ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { java . lang . String [ ] names = handleDeprecation ( org . apache . hadoop . conf . Configuration . deprecationContext . get ( ) , name ) ; java . lang . String result = null ; for ( java . lang . String n : names ) { result = substituteVars ( getProps ( ) . getProperty ( n ) ) ; } return result ; } | org . junit . Assert . assertEquals ( "hello" , conf . get ( "newkey" ) ) |
testCreateDDMExpression ( ) { com . liferay . dynamic . data . mapping . expression . internal . DDMExpressionFactoryImpl ddmExpressionFactory = new com . liferay . dynamic . data . mapping . expression . internal . DDMExpressionFactoryImpl ( ) ; ddmExpressionFactory . ddmExpressionFunctionTracker = _ddmExpressionFunctionTracker ; java . util . Map < java . lang . String , com . liferay . dynamic . data . mapping . expression . DDMExpressionFunction > functions = new java . util . HashMap ( ) { { put ( "pow" , new com . liferay . dynamic . data . mapping . expression . internal . functions . PowFunction ( ) ) ; } } ; when ( _ddmExpressionFunctionTracker . getDDMExpressionFunctions ( org . mockito . Matchers . any ( ) ) ) . thenReturn ( functions ) ; com . liferay . dynamic . data . mapping . expression . CreateExpressionRequest . Builder builder = CreateExpressionRequest . Builder . newBuilder ( "pow(2,3)" ) ; com . liferay . dynamic . data . mapping . expression . DDMExpression < java . math . BigDecimal > ddmExpression = ddmExpressionFactory . createExpression ( builder . build ( ) ) ; java . math . BigDecimal actual = ddmExpression . evaluate ( ) ; "<AssertPlaceHolder>" ; } compareTo ( com . liferay . adaptive . media . image . model . AMImageEntry ) { long primaryKey = amImageEntry . getPrimaryKey ( ) ; if ( ( getPrimaryKey ( ) ) < primaryKey ) { return - 1 ; } else if ( ( getPrimaryKey ( ) ) > primaryKey ) { return 1 ; } else { return 0 ; } } | org . junit . Assert . assertEquals ( 0 , actual . compareTo ( new java . math . BigDecimal ( 8 ) ) ) |
testExonicThreePrimeOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t59012403\t.\tN\t<INS:ME>\t.\t.\tSVTYPE=INS;END=59012403" ) ; final java . lang . String expected = "1\t59012403\t.\tN\t<INS:ME>\t.\t.\tEND=59012403;" + ( "SVANN=insertion&5_prime_UTR_exon_variant&mobile_element_insertion&structural_variant&" + "coding_transcript_variant|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;SVTYPE=INS" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
getControllerInstanceStatus_ProvException_isBusyMessage ( ) { paramHandler . setState ( FlowState . VSERVER_CREATED ) ; org . oscm . app . iaas . exceptions . IaasException mockIaasException = mock ( org . oscm . app . iaas . exceptions . IaasException . class ) ; doReturn ( Boolean . TRUE ) . when ( mockIaasException ) . isBusyMessage ( ) ; doThrow ( mockIaasException ) . when ( processManagerBean . vServerProcessor ) . process ( anyString ( ) , anyString ( ) , any ( org . oscm . app . iaas . PropertyHandler . class ) ) ; org . oscm . app . v2_0 . data . InstanceStatus result = processManagerBean . getControllerInstanceStatus ( "controllerId" , "instanceId" , paramHandler ) ; "<AssertPlaceHolder>" ; } getControllerInstanceStatus ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler ) { if ( paramHandler . isInstanceSuspended ( ) ) { return getInstanceStatusForSuspendedInstance ( ) ; } org . oscm . app . iaas . data . FlowState oldState = paramHandler . getState ( ) ; performProvisioningProcessing ( controllerId , instanceId , paramHandler ) ; org . oscm . app . iaas . data . FlowState state = paramHandler . getState ( ) ; if ( state == ( org . oscm . app . iaas . data . FlowState . FAILED ) ) { throw new org . oscm . app . v2_0 . exceptions . APPlatformException ( org . oscm . app . iaas . i18n . Messages . getAll ( "error_operation" ) ) ; } org . oscm . app . iaas . data . Operation operation = paramHandler . getOperation ( ) ; org . oscm . app . v2_0 . data . InstanceStatus result = new org . oscm . app . v2_0 . data . InstanceStatus ( ) ; result . setIsReady ( ( ( ( state == ( org . oscm . app . iaas . data . FlowState . FINISHED ) ) && ( ( operation != null ) && ( ! ( operation . isDeletion ( ) ) ) ) ) || ( state == ( org . oscm . app . iaas . data . FlowState . DESTROYED ) ) ) ) ; result . setRunWithTimer ( ( state != ( org . oscm . app . iaas . data . FlowState . MANUAL ) ) ) ; if ( state == ( org . oscm . app . iaas . data . FlowState . VSERVERS_STOPPING ) ) { result . setAccessInfo ( org . oscm . app . iaas . i18n . Messages . get ( paramHandler . getCustomerLocale ( ) , "accessInfo_NOT_AVAILABLE" ) ) ; } if ( result . isReady ( ) ) { if ( ( state != ( org . oscm . app . iaas . data . FlowState . DESTROYED ) ) && ( oldState != ( org . oscm . app . iaas . data . FlowState . VSERVERS_STOPPING ) ) ) { result . setAccessInfo ( getConnectionData ( instanceId , paramHandler ) ) ; } sendMailAboutModification ( instanceId , paramHandler ) ; } return result ; } | org . junit . Assert . assertNotNull ( result ) |
getPathReturnsEmptyArrayWhenChildNotFound ( ) { org . zkoss . ganttz . util . MutableTreeModelTest . Prueba root = new org . zkoss . ganttz . util . MutableTreeModelTest . Prueba ( ) ; org . zkoss . ganttz . util . MutableTreeModel < org . zkoss . ganttz . util . MutableTreeModelTest . Prueba > model = org . zkoss . ganttz . util . MutableTreeModel . create ( org . zkoss . ganttz . util . MutableTreeModelTest . Prueba . class , root ) ; org . zkoss . ganttz . util . MutableTreeModelTest . Prueba child = new org . zkoss . ganttz . util . MutableTreeModelTest . Prueba ( ) ; model . add ( root , child ) ; "<AssertPlaceHolder>" ; } equalTo ( T extends java . lang . Comparable ) { return org . zkoss . ganttz . data . constraint . ConstraintOnComparableValues . instantiate ( org . zkoss . ganttz . data . constraint . ConstraintOnComparableValues . ComparisonType . EQUAL_TO , value ) ; } | org . junit . Assert . assertThat ( model . getPath ( root , new org . zkoss . ganttz . util . MutableTreeModelTest . Prueba ( ) ) , org . hamcrest . CoreMatchers . equalTo ( new int [ 0 ] ) ) |
testToStringOnClass ( ) { java . lang . Class < ? > data = org . dkpro . lab . Util . class ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( _count ) ; sb . append ( "<sp>of<sp>" ) ; sb . append ( _limit ) ; if ( ( ( _count ) > 0 ) && ( ( _limit ) > 0 ) ) { final int perc = 100 - ( ( int ) ( ( ( ( _limit ) - ( _count ) ) * 100 ) / ( _limit ) ) ) ; sb . append ( "<sp>(" ) ; sb . append ( perc ) ; sb . append ( "%<sp>ETA<sp>" ) ; final double timeSoFar = ( _last ) - ( _start ) ; final long estTotal = java . lang . Math . round ( ( ( timeSoFar / ( _count ) ) * ( _limit ) ) ) ; final long timeLeft = java . lang . Math . round ( ( estTotal - timeSoFar ) ) ; sb . append ( org . dkpro . lab . ProgressMeter . milliToStringShort ( timeLeft ) ) ; sb . append ( "<sp>RUN<sp>" ) ; sb . append ( org . dkpro . lab . ProgressMeter . milliToStringShort ( ( ( _last ) - ( _start ) ) ) ) ; sb . append ( "<sp>AVG<sp>" ) ; sb . append ( java . lang . Math . round ( ( timeSoFar / ( _count ) ) ) ) ; sb . append ( "<sp>LAST<sp>" ) ; sb . append ( ( ( _last ) - ( _preLast ) ) ) ; sb . append ( ")" ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( org . dkpro . lab . Util . class . toString ( ) , org . dkpro . lab . Util . toString ( data ) ) |
testFloatConversion ( ) { com . s24 . search . solr . util . packed . OffsetGrowableFloatWriter writer = new com . s24 . search . solr . util . packed . OffsetGrowableFloatWriter ( OffsetGrowableFloatWriter . DEFAULT_PRECISION , 2 , 4096 , org . apache . lucene . util . packed . PackedInts . DEFAULT ) ; for ( int i = 0 ; i < 4096 ; i ++ ) { float value = ( org . apache . commons . lang . math . RandomUtils . nextFloat ( ) ) * ( org . apache . commons . lang . math . RandomUtils . nextFloat ( ) ) ; writer . setFloat ( i , value ) ; "<AssertPlaceHolder>" ; } } getFloat ( int ) { checkArgument ( ( ( index >= 0 ) && ( index < ( cache . length ) ) ) , "Pre-condition<sp>violated:<sp>expression<sp>index<sp>>=0<sp>&&<sp>index<sp><<sp>cache.length<sp>must<sp>be<sp>true." ) ; return cache [ index ] ; } | org . junit . Assert . assertEquals ( value , writer . getFloat ( i ) , OffsetGrowableFloatWriter . DEFAULT_PRECISION ) |
setStyleRemove ( ) { c . addStyleName ( "foo" ) ; c . setStyleName ( "foo" , false ) ; "<AssertPlaceHolder>" ; } getStyleName ( ) { return styleName ; } | org . junit . Assert . assertEquals ( "" , c . getStyleName ( ) ) |
testIsAsyncEventQueueUsingDiskStoreWhenUsingDefaultDiskStore ( ) { final com . gemstone . gemfire . cache . asyncqueue . AsyncEventQueue mockQueue = mockContext . mock ( com . gemstone . gemfire . cache . asyncqueue . AsyncEventQueue . class , "AsyncEventQueue" ) ; final com . gemstone . gemfire . cache . DiskStore mockDiskStore = mockContext . mock ( com . gemstone . gemfire . cache . DiskStore . class , "DiskStore" ) ; mockContext . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockQueue ) . getDiskStoreName ( ) ; will ( returnValue ( "<sp>" ) ) ; oneOf ( mockQueue ) . isPersistent ( ) ; will ( returnValue ( true ) ) ; oneOf ( mockDiskStore ) . getName ( ) ; will ( returnValue ( DiskStoreDetails . DEFAULT_DISK_STORE_NAME ) ) ; } } ) ; final com . gemstone . gemfire . management . internal . cli . functions . DescribeDiskStoreFunction function = createDescribeDiskStoreFunction ( null ) ; "<AssertPlaceHolder>" ; } isUsingDiskStore ( com . gemstone . gemfire . cache . Region , com . gemstone . gemfire . cache . DiskStore ) { return ( ( isPersistent ( region ) ) || ( isOverflowToDisk ( region ) ) ) && ( com . gemstone . gemfire . internal . lang . ObjectUtils . equals ( getDiskStoreName ( region ) , diskStore . getName ( ) ) ) ; } | org . junit . Assert . assertTrue ( function . isUsingDiskStore ( mockQueue , mockDiskStore ) ) |
testGetAvailableOutputFormats ( ) { final java . util . HashMap < edu . illinois . library . cantaloupe . image . Format , java . util . Set < edu . illinois . library . cantaloupe . image . Format > > formats = new java . util . HashMap ( ) ; for ( edu . illinois . library . cantaloupe . image . Format format : edu . illinois . library . cantaloupe . processor . codec . ImageReaderFactory . supportedFormats ( ) ) { formats . put ( format , edu . illinois . library . cantaloupe . processor . codec . ImageWriterFactory . supportedFormats ( ) ) ; } edu . illinois . library . cantaloupe . processor . Processor proc = newInstance ( ) ; proc . setSourceFormat ( Format . JPG ) ; java . util . Set < edu . illinois . library . cantaloupe . image . Format > expectedFormats = formats . get ( Format . JPG ) ; "<AssertPlaceHolder>" ; } getAvailableOutputFormats ( ) { if ( ( edu . illinois . library . cantaloupe . processor . ImageMagickProcessorTest . supportedFormats ) == null ) { final java . util . Set < edu . illinois . library . cantaloupe . image . Format > sourceFormats = new java . util . HashSet ( ) ; final java . util . Set < edu . illinois . library . cantaloupe . image . Format > outputFormats = new java . util . HashSet ( ) ; java . lang . String cmdPath = "identify" ; java . lang . Runtime runtime = java . lang . Runtime . getRuntime ( ) ; edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; config . clear ( ) ; java . lang . String pathPrefix = config . getString ( Key . IMAGEMAGICKPROCESSOR_PATH_TO_BINARIES ) ; if ( pathPrefix != null ) { cmdPath = ( pathPrefix + ( java . io . File . separator ) ) + cmdPath ; } java . lang . String [ ] commands = new java . lang . String [ ] { cmdPath , "JPEG" 2 , "format" } ; java . lang . Process proc = runtime . exec ( commands ) ; java . io . InputStreamReader reader = new java . io . InputStreamReader ( proc . getInputStream ( ) ) ; try ( java . io . BufferedReader buffReader = new java . io . BufferedReader ( reader ) ) { java . lang . String s ; while ( ( s = buffReader . readLine ( ) ) != null ) { s = s . trim ( ) ; if ( s . startsWith ( "JPEG" 1 ) ) { sourceFormats . add ( Format . BMP ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . BMP ) ; } } else if ( s . startsWith ( "DCM" ) ) { sourceFormats . add ( Format . DCM ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . DCM ) ; } } else if ( s . startsWith ( "GIF" ) ) { sourceFormats . add ( Format . GIF ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . GIF ) ; } } else if ( s . startsWith ( "JP2" ) ) { sourceFormats . add ( Format . JP2 ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . JP2 ) ; } } else if ( s . startsWith ( "JPEG" ) ) { sourceFormats . add ( Format . JPG ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . JPG ) ; } } else if ( ( s . startsWith ( "JPEG" 0 ) ) && ( s . contains ( "<sp>r" ) ) ) { sourceFormats . add ( Format . PDF ) ; } else if ( s . startsWith ( "PNG" ) ) { sourceFormats . add ( Format . PNG ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . PNG ) ; } } else if ( s . startsWith ( "JPEG" 3 ) ) { sourceFormats . add ( Format . TIF ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . TIF ) ; } } else if ( s . startsWith ( "WEBP" ) ) { sourceFormats . add ( Format . WEBP ) ; if ( s . contains ( "<sp>rw" ) ) { outputFormats . add ( Format . WEBP ) ; } } } } edu . illinois . library . cantaloupe . processor . ImageMagickProcessorTest . supportedFormats = new java . util . HashMap ( ) ; for ( edu . illinois . library . cantaloupe . image . Format format : edu . illinois . library . cantaloupe . image . Format . values ( ) ) { edu . illinois . library . cantaloupe . processor . ImageMagickProcessorTest . supportedFormats . put ( format , new java . util . HashSet ( ) ) ; } for ( edu . illinois . library . cantaloupe . image . Format format : sourceFormats ) { edu . illinois . library . cantaloupe . processor . ImageMagickProcessorTest . supportedFormats . put ( format , outputFormats ) ; } } return edu . illinois . library . cantaloupe . processor . ImageMagickProcessorTest . supportedFormats ; } | org . junit . Assert . assertEquals ( expectedFormats , proc . getAvailableOutputFormats ( ) ) |
testBuildWithDisabledStatusConstraintWithOrderBy ( ) { unit . setActive ( false ) ; org . lnu . is . domain . benefit . Benefit context = new org . lnu . is . domain . benefit . Benefit ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "benefitType" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "parent" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "abbrName" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy4 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy5 = new org . lnu . is . pagination . OrderBy ( "begdate" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy6 = new org . lnu . is . pagination . OrderBy ( "enddate" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy7 = new org . lnu . is . pagination . OrderBy ( "description" , org . lnu . is . pagination . OrderByType . ASC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 , orderBy3 , orderBy4 , orderBy5 , orderBy6 , orderBy7 ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>Benefit<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>ORDER<sp>BY<sp>e.benefitType<sp>ASC,<sp>e.parent<sp>DESC,<sp>e.abbrName<sp>ASC,<sp>e.name<sp>DESC,<sp>e.begdate<sp>ASC,<sp>e.enddate<sp>DESC,<sp>e.description<sp>ASC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . benefit . Benefit > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; } | org . junit . Assert . assertEquals ( expected , actualQuery ) |
traversal_query_should_success ( ) { int numberOfFriends = 0 ; try ( org . neo4j . graphdb . Transaction tx = graphDb . beginTx ( ) ) { fr . jetoile . hadoopunit . component . Node neoNode = graphDb . createNode ( ) ; neoNode . setProperty ( "name" , "Hello,<sp>" ) ; fr . jetoile . hadoopunit . component . Node secondNode = graphDb . createNode ( ) ; secondNode . setProperty ( "name" , "World!" ) ; fr . jetoile . hadoopunit . component . Node thirdNode = graphDb . createNode ( ) ; secondNode . setProperty ( "name" , "World2!" ) ; fr . jetoile . hadoopunit . component . Relationship relationship = neoNode . createRelationshipTo ( secondNode , fr . jetoile . hadoopunit . component . Neo4jBootstrapTest . RelTypes . KNOWS ) ; fr . jetoile . hadoopunit . component . Relationship relationship2 = neoNode . createRelationshipTo ( thirdNode , fr . jetoile . hadoopunit . component . Neo4jBootstrapTest . RelTypes . KNOWS ) ; relationship . setProperty ( "message" , "brave<sp>Neo4j<sp>" ) ; relationship2 . setProperty ( "message" , "brave<sp>Neo4j2<sp>" ) ; tx . success ( ) ; org . neo4j . graphdb . traversal . Traverser friendsTraverser = getFriends ( graphDb , neoNode ) ; for ( fr . jetoile . hadoopunit . component . Path friendPath : friendsTraverser ) { numberOfFriends ++ ; } "<AssertPlaceHolder>" ; } } getFriends ( fr . jetoile . hadoopunit . component . GraphDatabaseService , fr . jetoile . hadoopunit . component . Node ) { org . neo4j . graphdb . traversal . TraversalDescription td = graphDb . traversalDescription ( ) . breadthFirst ( ) . relationships ( fr . jetoile . hadoopunit . component . Neo4jBootstrapTest . RelTypes . KNOWS , Direction . OUTGOING ) . evaluator ( org . neo4j . graphdb . traversal . Evaluators . excludeStartPosition ( ) ) ; return td . traverse ( person ) ; } | org . junit . Assert . assertEquals ( 2 , numberOfFriends ) |
createArrayList_varArgs_withNull ( ) { java . util . List < java . lang . Integer > list = createArrayList ( ( ( java . lang . Integer [ ] ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } createArrayList ( int ) { return new java . util . ArrayList < T > ( initialCapacity ) ; } | org . junit . Assert . assertTrue ( ( list instanceof java . util . ArrayList < ? > ) ) |
testParseSpecificTimeStringUsingTimeFormat ( ) { java . time . LocalDateTime expectedDateTime = java . time . LocalDateTime . of ( 2014 , 11 , 11 , 10 , 11 , 11 ) ; java . time . LocalDateTime parsedTime = org . fastframework . core . util . TimeUtil . parseTime ( "2014/11/11<sp>10:11:11" , TimeUtil . TimeFormat . LONG_DATE_PATTERN_SLASH ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( expectedDateTime , parsedTime ) |
testLotSets ( ) { java . lang . String code = "" ; try { code = _setupTestLot ( true ) ; _checkLotIntoDb ( code ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } return ; } _checkLotIntoDb ( java . lang . String ) { org . isf . medicalstock . model . Lot foundLot ; foundLot = ( ( org . isf . medicalstock . model . Lot ) ( org . isf . medicalstock . test . Tests . jpa . find ( org . isf . medicalstock . model . Lot . class , code ) ) ) ; org . isf . medicalstock . test . Tests . testLot . check ( foundLot ) ; return ; } | org . junit . Assert . assertEquals ( true , false ) |
receiveThrowsTransportExceptionOnAnythingOtherThenPatchOrResTopic ( ) { final byte [ ] actualPayload = "NotificationResponseDataContainingDesiredPropertiesDocument" . getBytes ( ) ; final java . lang . String expectedTopic = ( "$iothub/twin/NOTPATCH_NOTRES/properties/" + "?$version=" ) + ( mockVersion ) ; com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage receivedMessage = null ; try { com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttDeviceTwin testTwin = new com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttDeviceTwin ( mockedMqttConnection , "" ) ; java . lang . String insertTopic = expectedTopic ; java . util . Queue < org . apache . commons . lang3 . tuple . Pair < java . lang . String , byte [ ] > > testAllReceivedMessages = new java . util . concurrent . ConcurrentLinkedQueue ( ) ; testAllReceivedMessages . add ( new org . apache . commons . lang3 . tuple . MutablePair ( insertTopic , actualPayload ) ) ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . Deencapsulation . setField ( testTwin , "allReceivedMessages" , testAllReceivedMessages ) ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . Deencapsulation . setField ( testTwin , "stateLock" , new java . lang . Object ( ) ) ; receivedMessage = ( ( com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage ) ( testTwin . receive ( ) ) ) ; } finally { "<AssertPlaceHolder>" ; } } receive ( ) { return receive ( DEFAULT_TIMEOUT_MS ) ; } | org . junit . Assert . assertNull ( receivedMessage ) |
addFirstAnnotationValuesToMap__SkipNullValue ( ) { when ( mockAnnotations . keySet ( ) ) . thenReturn ( com . google . common . collect . Sets . newHashSet ( annoKey1 ) ) ; when ( mockAnnotations . getSingleValue ( annoKey1 ) ) . thenReturn ( null ) ; spySearchDocumentDriver . addFirstAnnotationValuesToMap ( mockAnnotations , annoValuesMap ) ; verify ( mockAnnotations , times ( 1 ) ) . keySet ( ) ; verify ( mockAnnotations , times ( 1 ) ) . getSingleValue ( annoKey1 ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( ( ( ( stringAnnotations ) == null ) || ( stringAnnotations . isEmpty ( ) ) ) && ( ( ( doubleAnnotations ) == null ) || ( doubleAnnotations . isEmpty ( ) ) ) ) && ( ( ( longAnnotations ) == null ) || ( longAnnotations . isEmpty ( ) ) ) ) && ( ( ( dateAnnotations ) == null ) || ( dateAnnotations . isEmpty ( ) ) ) ) && ( ( ( blobAnnotations ) == null ) || ( blobAnnotations . isEmpty ( ) ) ) ; } | org . junit . Assert . assertTrue ( annoValuesMap . isEmpty ( ) ) |
testNestedNots2 ( ) { java . lang . String str = "package<sp>org.test;<sp>" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "rule<sp>shared_conjunct<sp>" + "package<sp>org.test;<sp>" 9 ) + "<sp>(not<sp>(String()<sp>and<sp>Integer()))<sp>" ) + "then<sp>" ) + "<sp>System.out.println(\"shared_conjunct\"package<sp>org.test;<sp>" 3 ) + "end<sp>" ) + "rule<sp>negation_over_nested<sp>" ) + "package<sp>org.test;<sp>" 9 ) + "package<sp>org.test;<sp>" 6 ) + "package<sp>org.test;<sp>" 8 ) + "package<sp>org.test;<sp>" 4 ) + "then<sp>" ) + "<sp>System.out.println(\"negation_over_nested\"package<sp>org.test;<sp>" 3 ) + "end<sp>" ) + "<sp>" ) + "rule<sp>negation_distributed_partially_no_sharing<sp>" ) + "package<sp>org.test;<sp>" 9 ) + "package<sp>org.test;<sp>" 2 ) + "package<sp>org.test;<sp>" 0 ) + "package<sp>org.test;<sp>" 2 ) + "then<sp>" ) + "<sp>System.out.println(\"negation_distributed_partially_no_sharing\"package<sp>org.test;<sp>" 3 ) + "end<sp>" ) + "<sp>" ) + "<sp>(not<sp>(String()<sp>and<sp>Integer()))<sp>" 0 ) + "package<sp>org.test;<sp>" 9 ) + "<sp>(not<sp>(String()<sp>and<sp>Integer()))<sp>" ) + "package<sp>org.test;<sp>" 0 ) + "<sp>(not<sp>(String()<sp>and<sp>Integer()))<sp>" ) + "then<sp>" ) + "<sp>System.out.println(\"negation_distributed_partially_sharing\"package<sp>org.test;<sp>" 3 ) + "end<sp>" ) + "<sp>" ) + "package<sp>org.test;<sp>" 5 ) + "package<sp>org.test;<sp>" 9 ) + "package<sp>org.test;<sp>" 1 ) + "package<sp>org.test;<sp>" 0 ) + "package<sp>org.test;<sp>" 1 ) + "then<sp>" ) + "<sp>System.out.println(\"negation_distributed_fully\"package<sp>org.test;<sp>" 3 ) + "package<sp>org.test;<sp>" 7 ) ; org . kie . api . KieServices ks = KieServices . Factory . get ( ) ; org . kie . api . builder . KieFileSystem kfs = ks . newKieFileSystem ( ) . write ( "src/main/resources/r1.drl" , str ) ; ks . newKieBuilder ( kfs ) . buildAll ( ) ; org . kie . api . runtime . KieSession ksession = ks . newKieContainer ( ks . getRepository ( ) . getDefaultReleaseId ( ) ) . newKieSession ( ) ; int n = ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 8 , n ) |
testAddServerString ( ) { final com . allanbank . mongodb . MongoClientConfiguration config = new com . allanbank . mongodb . MongoClientConfiguration ( ) ; config . addServer ( "foo:1234" ) ; config . addServer ( "bar:1234" ) ; "<AssertPlaceHolder>" ; } getServers ( ) { return new java . util . ArrayList < com . allanbank . mongodb . client . state . Server > ( myServers . values ( ) ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "foo:1234" , "bar:1234" ) , config . getServers ( ) ) |
testConvertTypeAtlasConversionException ( ) { "<AssertPlaceHolder>" ; } convertType ( java . lang . Object , io . atlasmap . v2 . FieldType , io . atlasmap . v2 . FieldType ) { if ( ( origSourceType == null ) || ( targetType == null ) ) { throw new io . atlasmap . api . AtlasConversionException ( "FieldTypes<sp>must<sp>be<sp>specified<sp>on<sp>convertType<sp>method." ) ; } if ( isAssignableFieldType ( origSourceType , targetType ) ) { return sourceValue ; } return convertType ( sourceValue , null , classFromFieldType ( targetType ) , null ) ; } | org . junit . Assert . assertNotNull ( service . convertType ( new java . lang . Object ( ) , null , null ) ) |
testRemoveSomeViaIterator ( ) { java . util . ArrayList < java . lang . Integer > list = org . apache . hadoop . util . TestLightWeightGSet . getRandomList ( 100 , 123 ) ; org . apache . hadoop . util . LightWeightGSet < org . apache . hadoop . util . TestLightWeightGSet . TestElement , org . apache . hadoop . util . TestLightWeightGSet . TestElement > set = new org . apache . hadoop . util . LightWeightGSet < org . apache . hadoop . util . TestLightWeightGSet . TestElement , org . apache . hadoop . util . TestLightWeightGSet . TestElement > ( 16 ) ; for ( java . lang . Integer i : list ) { set . put ( new org . apache . hadoop . util . TestLightWeightGSet . TestElement ( i ) ) ; } long sum = 0 ; for ( java . util . Iterator < org . apache . hadoop . util . TestLightWeightGSet . TestElement > iter = set . iterator ( ) ; iter . hasNext ( ) ; ) { sum += iter . next ( ) . getVal ( ) ; } long mode = sum / ( set . size ( ) ) ; org . apache . hadoop . util . TestLightWeightGSet . LOG . info ( ( "Removing<sp>all<sp>elements<sp>above<sp>" + mode ) ) ; for ( java . util . Iterator < org . apache . hadoop . util . TestLightWeightGSet . TestElement > iter = set . iterator ( ) ; iter . hasNext ( ) ; ) { int item = iter . next ( ) . getVal ( ) ; if ( item > mode ) { iter . remove ( ) ; } } for ( java . util . Iterator < org . apache . hadoop . util . TestLightWeightGSet . TestElement > iter = set . iterator ( ) ; iter . hasNext ( ) ; ) { "<AssertPlaceHolder>" ; } } next ( ) { if ( hasNext ( ) ) { return schedulingRequestList . get ( ( ( cursor ) ++ ) ) ; } throw new java . util . NoSuchElementException ( ) ; } | org . junit . Assert . assertTrue ( ( ( iter . next ( ) . getVal ( ) ) <= mode ) ) |
assertNonNullInjectionPointsWhenOverriding ( ) { final org . apache . deltaspike . core . util . bean . BeanBuilder beanBuilder = new org . apache . deltaspike . core . util . bean . BeanBuilder ( beanManager ) ; final javax . enterprise . inject . spi . AnnotatedType < ? > at = beanManager . createAnnotatedType ( org . apache . deltaspike . test . core . api . util . bean . WithInjectionPoint . class ) ; beanBuilder . readFromType ( at ) ; final java . util . Set < javax . enterprise . inject . spi . InjectionPoint > origInjectionPoints = beanBuilder . getInjectionPoints ( ) ; beanBuilder . injectionPoints ( beanBuilder . getInjectionPoints ( ) ) ; final java . util . Set < javax . enterprise . inject . spi . InjectionPoint > newInjectionPoints = new java . util . HashSet < javax . enterprise . inject . spi . InjectionPoint > ( ) ; for ( javax . enterprise . inject . spi . InjectionPoint ip : origInjectionPoints ) { newInjectionPoints . add ( new org . apache . deltaspike . core . util . metadata . builder . ImmutableInjectionPoint ( ( ( javax . enterprise . inject . spi . AnnotatedField ) ( ip . getAnnotated ( ) ) ) , ip . getQualifiers ( ) , null , ip . isTransient ( ) , ip . isDelegate ( ) ) ) ; } beanBuilder . injectionPoints ( newInjectionPoints ) ; final javax . enterprise . inject . spi . Bean < ? > newInjectionBean = beanBuilder . create ( ) ; for ( final javax . enterprise . inject . spi . InjectionPoint ip : newInjectionBean . getInjectionPoints ( ) ) { "<AssertPlaceHolder>" ; } } getInjectionPoints ( ) { return wrapped . getInjectionPoints ( ) ; } | org . junit . Assert . assertNotNull ( ip ) |
testAcceptValidParameter2 ( ) { state . setInput ( "select<sp>*;" ) ; "<AssertPlaceHolder>" ; } accept ( org . openspotlight . graph . query . console . ConsoleState ) { org . openspotlight . common . util . Assertions . checkNotNull ( "state" , state ) ; if ( ( ( state . getActiveCommand ( ) ) == null ) && ( state . getInput ( ) . trim ( ) . equals ( "display<sp>properties" ) ) ) { return true ; } return false ; } | org . junit . Assert . assertThat ( command . accept ( state ) , org . hamcrest . core . Is . is ( true ) ) |
testSerialize ( ) { final java . util . List < org . pac4j . core . profile . CommonProfile > profiles = new java . util . ArrayList ( ) ; final io . buji . pac4j . subject . Pac4jPrincipal principal = new io . buji . pac4j . subject . Pac4jPrincipal ( profiles ) ; final org . apache . shiro . io . DefaultSerializer serializer = new org . apache . shiro . io . DefaultSerializer ( ) ; final byte [ ] serialized = serializer . serialize ( principal ) ; final io . buji . pac4j . subject . Pac4jPrincipal principal2 = ( ( io . buji . pac4j . subject . Pac4jPrincipal ) ( serializer . deserialize ( serialized ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( principal2 , principal ) |
addAllFront2RemovedTest ( ) { java . util . List < java . lang . Integer > toAddList = new java . util . ArrayList ( 5 ) ; toAddList . add ( 100 ) ; toAddList . add ( 200 ) ; toAddList . add ( 300 ) ; toAddList . add ( 400 ) ; toAddList . add ( 500 ) ; org . threadly . concurrent . collections . ConcurrentArrayList . DataSet < java . lang . Integer > result = org . threadly . concurrent . collections . ConcurrentArrayListDataSetTest . removed2FromFront . addAll ( toAddList ) ; java . lang . Integer [ ] expectedResult = new java . lang . Integer [ ] { 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 100 , 200 , 300 , 400 , 500 } ; "<AssertPlaceHolder>" ; } makeDataSet ( java . lang . Object [ ] , int , int ) { return new org . threadly . concurrent . collections . ConcurrentArrayList . DataSet ( dataArray , startPosition , endPosition , 0 , 0 ) ; } | org . junit . Assert . assertTrue ( result . equals ( org . threadly . concurrent . collections . ConcurrentArrayListDataSetTest . makeDataSet ( expectedResult , 0 , expectedResult . length ) ) ) |
testDropTable ( ) { java . util . Map < java . lang . String , java . util . Collection < java . lang . String > > update = new java . util . HashMap ( ) ; update . put ( org . apache . sentry . service . thrift . TestFullUpdateModifier . AUTH , java . util . Collections . singleton ( org . apache . sentry . service . thrift . TestFullUpdateModifier . PATH ) ) ; org . apache . hadoop . hive . metastore . api . NotificationEvent event = new org . apache . hadoop . hive . metastore . api . NotificationEvent ( 0 , 0 , org . apache . sentry . service . thrift . DROP_TABLE . toString ( ) , "" ) ; org . apache . hadoop . hive . metastore . messaging . MessageDeserializer deserializer = org . mockito . Mockito . mock ( org . apache . sentry . binding . metastore . messaging . json . SentryJSONMessageDeserializer . class ) ; org . apache . sentry . binding . metastore . messaging . json . SentryJSONDropTableMessage message = new org . apache . sentry . binding . metastore . messaging . json . SentryJSONDropTableMessage ( org . apache . sentry . service . thrift . TestFullUpdateModifier . SERVER , org . apache . sentry . service . thrift . TestFullUpdateModifier . PRINCIPAL , org . apache . sentry . service . thrift . TestFullUpdateModifier . DB , org . apache . sentry . service . thrift . TestFullUpdateModifier . TABLE , 0L , org . apache . sentry . service . thrift . TestFullUpdateModifier . LOCATION ) ; org . mockito . Mockito . when ( deserializer . getDropTableMessage ( "" ) ) . thenReturn ( message ) ; org . apache . sentry . service . thrift . FullUpdateModifier . applyEvent ( update , event , deserializer ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( permUpdates ) == null ) || ( permUpdates . isEmpty ( ) ) ) && ( ( ( pathUpdates ) == null ) || ( pathUpdates . isEmpty ( ) ) ) ; } | org . junit . Assert . assertTrue ( update . isEmpty ( ) ) |
testGetServerNameNull ( ) { com . intel . mtwilson . HtmlErrorParser htmlerrorparser = new com . intel . mtwilson . HtmlErrorParser ( null ) ; "<AssertPlaceHolder>" ; } getServerName ( ) { return serverName ; } | org . junit . Assert . assertEquals ( null , htmlerrorparser . getServerName ( ) ) |
checkProgrammingLanguage ( ) { org . zalando . catwatch . backend . service . LanguageServiceTest . logger . info ( "Setting<sp>up<sp>the<sp>projects..." ) ; org . zalando . catwatch . backend . model . Project p1 = new org . zalando . catwatch . backend . repo . builder . ProjectBuilder ( ) . commitsCount ( 10 ) . contributorsCount ( 5 ) . forksCount ( 1 ) . gitHubProjectId ( 12345 ) . description ( "bogus<sp>project<sp>1" ) . name ( "bogus<sp>project<sp>1" ) . primaryLanguage ( "Java" ) . organizationName ( "zalando-stups" ) . getProject ( ) ; org . zalando . catwatch . backend . model . Project p2 = new org . zalando . catwatch . backend . repo . builder . ProjectBuilder ( ) . commitsCount ( 10 ) . contributorsCount ( 5 ) . forksCount ( 1 ) . gitHubProjectId ( 12345 ) . description ( "Java" 1 ) . name ( "Java" 1 ) . primaryLanguage ( "Scala" ) . organizationName ( "zalando-stups" ) . getProject ( ) ; org . zalando . catwatch . backend . model . Project p3 = new org . zalando . catwatch . backend . repo . builder . ProjectBuilder ( ) . commitsCount ( 10 ) . contributorsCount ( 5 ) . forksCount ( 1 ) . gitHubProjectId ( 12345 ) . description ( "bogus<sp>project<sp>3" ) . name ( "bogus<sp>project<sp>3" ) . primaryLanguage ( "C++" ) . organizationName ( "Java" 0 ) . getProject ( ) ; org . zalando . catwatch . backend . model . Project p4 = new org . zalando . catwatch . backend . repo . builder . ProjectBuilder ( ) . commitsCount ( 10 ) . contributorsCount ( 5 ) . forksCount ( 1 ) . gitHubProjectId ( 12345 ) . description ( "bogus<sp>project<sp>4" ) . name ( "bogus<sp>project<sp>4" ) . primaryLanguage ( null ) . organizationName ( "Java" 0 ) . getProject ( ) ; projectRepository . save ( p1 ) ; projectRepository . save ( p2 ) ; projectRepository . save ( p3 ) ; projectRepository . save ( p4 ) ; java . lang . String organizations = "zalando,zalando-stups" ; org . zalando . catwatch . backend . service . LanguageServiceTest . logger . info ( "Calling<sp>language<sp>service..." ) ; java . util . List < org . zalando . catwatch . backend . model . Project > projectsZalando = new java . util . ArrayList ( ) ; java . util . List < org . zalando . catwatch . backend . model . Project > projectsZalandoStups = new java . util . ArrayList ( ) ; projectsZalandoStups . add ( p1 ) ; projectsZalandoStups . add ( p2 ) ; projectsZalando . add ( p3 ) ; projectsZalando . add ( p4 ) ; when ( projectRepository . findProjects ( "Java" 0 , empty ( ) , empty ( ) ) ) . thenReturn ( projectsZalando ) ; when ( projectRepository . findProjects ( "zalando-stups" , empty ( ) , empty ( ) ) ) . thenReturn ( projectsZalandoStups ) ; java . util . List < org . zalando . catwatch . backend . model . Language > result = languageService . getMainLanguages ( organizations , new org . zalando . catwatch . backend . service . LanguageServiceTest . LanguagePercentComparator ( ) , empty ( ) ) ; "<AssertPlaceHolder>" ; } getMainLanguages ( java . lang . String , java . util . Comparator , java . util . Optional ) { java . util . Collection < java . lang . String > organizationList = org . zalando . catwatch . backend . util . StringParser . parseStringList ( organizations , "," ) ; java . util . List < org . zalando . catwatch . backend . model . Project > projectList = new java . util . ArrayList ( ) ; for ( java . lang . String org : organizationList ) { java . lang . Iterable < org . zalando . catwatch . backend . model . Project > projects = repository . findProjects ( org , java . util . Optional . empty ( ) , filterLanguage ) ; for ( org . zalando . catwatch . backend . model . Project project : projects ) { projectList . add ( project ) ; } } java . util . List < java . lang . String > languageList = new java . util . ArrayList ( ) ; for ( org . zalando . catwatch . backend . model . Project p : projectList ) { if ( org . apache . commons . lang . StringUtils . isEmpty ( p . getPrimaryLanguage ( ) ) ) { org . zalando . catwatch . backend . service . LanguageService . logger . info ( java . lang . String . format ( "No<sp>primary<sp>programming<sp>language<sp>set<sp>for<sp>project<sp>[%s]." , p . getName ( ) ) ) ; continue ; } languageList . add ( p . getPrimaryLanguage ( ) ) ; } java . util . List < org . zalando . catwatch . backend . model . Language > languages = new java . util . ArrayList ( ) ; java . util . Set < java . lang . String > languageSet = new java . util . HashSet ( languageList ) ; int frequency ; for ( java . lang . String language : languageSet ) { org . zalando . catwatch . backend . model . Language l = new org . zalando . catwatch . backend . model . Language ( language ) ; frequency = java . util . Collections . frequency ( languageList , language ) ; l . setPercentage ( ( ( int ) ( java . lang . Math . round ( ( ( ( ( double ) ( frequency ) ) / ( languageList . size ( ) ) ) * 100 ) ) ) ) ) ; l . setProjectsCount ( frequency ) ; languages | org . junit . Assert . assertEquals ( 3 , result . size ( ) ) |
testSuccessScenario ( ) { new akka . testkit . JavaTestKit ( org . restcomm . connect . commons . patterns . ObserverPatternTest . system ) { { final akka . actor . ActorRef observer = getRef ( ) ; final akka . actor . Props properties = new akka . actor . Props ( org . restcomm . connect . commons . patterns . ObserverPatternTest . ObservableActor . class ) ; final akka . actor . ActorRef observable = org . restcomm . connect . commons . patterns . ObserverPatternTest . system . actorOf ( properties ) ; observable . tell ( new org . restcomm . connect . commons . patterns . Observe ( observer ) , observer ) ; org . restcomm . connect . commons . patterns . Observing response = expectMsgClass ( org . restcomm . connect . commons . patterns . Observing . class ) ; "<AssertPlaceHolder>" ; observable . tell ( new org . restcomm . connect . commons . patterns . ObserverPatternTest . BroadcastHelloWorld ( ) , observer ) ; expectMsgEquals ( "Hello<sp>World!" ) ; observable . tell ( new org . restcomm . connect . commons . patterns . StopObserving ( observer ) , observer ) ; } } ; } succeeded ( ) { return succeeded ; } | org . junit . Assert . assertTrue ( response . succeeded ( ) ) |
testGetRemitToResultsNull ( ) { org . oscarehr . common . dao . BillingONCHeader1Dao cHeader1Dao = ( ( org . oscarehr . common . dao . BillingONCHeader1Dao ) ( org . oscarehr . util . SpringUtils . getBean ( org . oscarehr . common . dao . BillingONCHeader1Dao . class ) ) ) ; org . oscarehr . common . model . BillingONCHeader1 cHeader1 = new org . oscarehr . common . model . BillingONCHeader1 ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( cHeader1 ) ; org . oscarehr . common . model . BillingONExt extraBillingPayment = new org . oscarehr . common . model . BillingONExt ( ) ; extraBillingPayment . setBillingNo ( 1 ) ; extraBillingPayment . setPaymentId ( 1 ) ; extraBillingPayment . setStatus ( 'A' ) ; extraBillingPayment . setKeyVal ( "remitTo" ) ; cHeader1Dao . persist ( cHeader1 ) ; dao . persist ( extraBillingPayment ) ; org . oscarehr . common . model . BillingONExt billingRecord = dao . getRemitTo ( cHeader1 ) ; "<AssertPlaceHolder>" ; } getRemitTo ( org . oscarehr . common . model . BillingONCHeader1 ) { org . oscarehr . common . model . BillingONExt bExt = null ; java . lang . String sql = "select<sp>bExt<sp>from<sp>BillingONExt<sp>bExt<sp>where<sp>billingNo=?<sp>and<sp>status=?<sp>and<sp>keyVal=?" ; javax . persistence . Query query = entityManager . createQuery ( sql ) ; query . setParameter ( 1 , bCh1 . getId ( ) ) ; query . setParameter ( 2 , '1' ) ; query . setParameter ( 3 , "remitTo" ) ; java . util . List < org . oscarehr . common . model . BillingONExt > results = query . getResultList ( ) ; if ( ( results . size ( ) ) > 1 ) { org . oscarehr . util . MiscUtils . getLogger ( ) . warn ( ( "More<sp>than<sp>one<sp>active<sp>remit<sp>to<sp>result<sp>for<sp>invoice<sp>number:<sp>" + ( bCh1 . getId ( ) ) ) ) ; } if ( ! ( results . isEmpty ( ) ) ) bExt = results . get ( 0 ) ; return bExt ; } | org . junit . Assert . assertNull ( billingRecord ) |
shouldReturnThatHasDomain ( ) { com . openshift . client . utils . DomainTestUtils . ensureHasDomain ( user ) ; java . lang . Boolean hasDomain = user . hasDomain ( ) ; "<AssertPlaceHolder>" ; } hasDomain ( ) { return ( api . getDomains ( ) . size ( ) ) > 0 ; } | org . junit . Assert . assertTrue ( hasDomain ) |
differentObjectsShouldNotBeEqual ( ) { de . thm . arsnova . model . Feedback f = new de . thm . arsnova . model . Feedback ( 0 , 0 , 0 , 0 ) ; java . lang . String x = "" ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } de . thm . arsnova . model . migration . v2 . RoomInfo other = ( ( de . thm . arsnova . model . migration . v2 . RoomInfo ) ( obj ) ) ; if ( ( keyword ) == null ) { if ( ( other . keyword ) != null ) { return false ; } } else if ( ! ( keyword . equals ( other . keyword ) ) ) { return false ; } return true ; } | org . junit . Assert . assertFalse ( f . equals ( x ) ) |
testReferenceDateIsNotChanged ( ) { java . util . Date referenceDate = initialHistory . getReferenceDate ( ) ; processor . process ( exchange ) ; processor . process ( exchange ) ; "<AssertPlaceHolder>" ; } getMeasurementHistory ( org . apache . camel . Exchange ) { org . openehealth . ipf . commons . test . performance . MeasurementHistory history = getMeasurementHistoryFromMessageHeader ( exchange ) ; if ( history == null ) { java . lang . String msg = java . lang . String . format ( ( "No<sp>measurement<sp>history<sp>can<sp>be<sp>found,<sp>as<sp>expected,<sp>at<sp>location<sp>%1$s." + ( "<sp>The<sp>measurement<sp>history<sp>is<sp>created<sp>by<sp>the<sp>first<sp>measure().time()<sp>of<sp>the<sp>route," + "<sp>and<sp>is<sp>stored<sp>in<sp>the<sp>%2$s<sp>header<sp>of<sp>the<sp>in<sp>message." ) ) , name , org . openehealth . ipf . platform . camel . test . performance . process . MEASUREMENT_HISTORY_HEADER_KEY ) ; throw new java . lang . IllegalStateException ( msg ) ; } return history ; } | org . junit . Assert . assertEquals ( referenceDate , processor . getMeasurementHistory ( exchange ) . getReferenceDate ( ) ) |
deveObterNumeroPedidoItemClienteComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemProduto produto = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemProduto ( ) ; final java . lang . Integer numeroPedidoItemCliente = 999999 ; produto . setNumeroPedidoItemCliente ( numeroPedidoItemCliente ) ; "<AssertPlaceHolder>" ; } getNumeroPedidoItemCliente ( ) { return this . numeroPedidoItemCliente ; } | org . junit . Assert . assertEquals ( numeroPedidoItemCliente , produto . getNumeroPedidoItemCliente ( ) ) |
testLoginFail ( ) { org . talend . components . salesforce . SalesforceConnectionProperties props = setupProps ( null , ( ! ( ADD_QUOTES ) ) ) ; props . userPassword . userId . setValue ( "blah" ) ; org . talend . daikon . properties . presentation . Form f = props . getForm ( SalesforceConnectionProperties . FORM_WIZARD ) ; props = ( ( org . talend . components . salesforce . SalesforceConnectionProperties ) ( org . talend . daikon . properties . test . PropertiesTestUtils . checkAndValidate ( getComponentService ( ) , f , "testConnection" , props ) ) ) ; org . talend . components . salesforce . integration . SalesforceComponentTestIT . LOGGER . debug ( props . getValidationResult ( ) . toString ( ) ) ; "<AssertPlaceHolder>" ; } getValidationResult ( ) { if ( ( ( prefix . getValue ( ) ) == null ) || ( prefix . getValue ( ) . isEmpty ( ) ) ) { return new org . talend . daikon . properties . ValidationResult ( org . talend . daikon . properties . ValidationResult . Result . ERROR , org . talend . components . azurestorage . blob . helpers . RemoteBlobsTable . messages . getMessage ( "error.VacantPrefix" ) ) ; } return org . talend . daikon . properties . ValidationResult . OK ; } | org . junit . Assert . assertEquals ( ValidationResult . Result . ERROR , props . getValidationResult ( ) . getStatus ( ) ) |
empty ( ) { final org . apache . isis . core . commons . config . IsisConfiguration subset = configuration . createSubset ( "foo" ) ; "<AssertPlaceHolder>" ; } iterator ( ) { return getClasses ( ) . iterator ( ) ; } | org . junit . Assert . assertThat ( subset . iterator ( ) . hasNext ( ) , org . hamcrest . CoreMatchers . is ( false ) ) |
testMutate ( ) { org . apache . commons . math3 . genetics . MutationPolicy mutation = new org . apache . commons . math3 . genetics . RandomKeyMutation ( ) ; int l = 10 ; for ( int i = 0 ; i < 20 ; i ++ ) { org . apache . commons . math3 . genetics . DummyRandomKey origRk = new org . apache . commons . math3 . genetics . DummyRandomKey ( org . apache . commons . math3 . genetics . RandomKey . randomPermutation ( l ) ) ; org . apache . commons . math3 . genetics . Chromosome mutated = mutation . mutate ( origRk ) ; org . apache . commons . math3 . genetics . DummyRandomKey mutatedRk = ( ( org . apache . commons . math3 . genetics . DummyRandomKey ) ( mutated ) ) ; int changes = 0 ; for ( int j = 0 ; j < ( origRk . getLength ( ) ) ; j ++ ) { if ( ( origRk . getRepresentation ( ) . get ( j ) ) != ( mutatedRk . getRepresentation ( ) . get ( j ) ) ) { changes ++ ; } } "<AssertPlaceHolder>" ; } } get ( int ) { java . lang . Object result = null ; if ( ( index >= 0 ) && ( index < ( this . size ) ) ) { result = this . objects [ index ] ; } return result ; } | org . junit . Assert . assertEquals ( 1 , changes ) |
sum_coalesce ( ) { int val = query ( ) . from ( com . querydsl . jpa . AbstractJPATest . cat ) . select ( com . querydsl . jpa . AbstractJPATest . cat . weight . sum ( ) . coalesce ( 0 ) ) . fetchFirst ( ) ; "<AssertPlaceHolder>" ; } fetchFirst ( ) { return oneResult ( false ) ; } | org . junit . Assert . assertTrue ( ( val == 0 ) ) |
iterator ( ) { int count = 1 ; for ( net . time4j . PlainDate date : net . time4j . range . CalendarWeek . of ( 2016 , 4 ) ) { System . out . println ( ( ( count + "<sp>=><sp>" ) + date ) ) ; count ++ ; } "<AssertPlaceHolder>" ; } of ( int , int ) { return new net . time4j . range . CalendarWeek ( yearOfWeekdate , weekOfYear ) ; } | org . junit . Assert . assertThat ( ( count - 1 ) , org . hamcrest . CoreMatchers . is ( 7 ) ) |
jdbcCompliant ( ) { "<AssertPlaceHolder>" ; } jdbcCompliant ( ) { return false ; } | org . junit . Assert . assertFalse ( subject . jdbcCompliant ( ) ) |
enableWhenWithHasAnswer ( ) { org . hl7 . fhir . dstu3 . model . Questionnaire resource = new org . hl7 . fhir . dstu3 . model . Questionnaire ( ) ; resource . setStatus ( Enumerations . PublicationStatus . ACTIVE ) ; org . hl7 . fhir . dstu3 . model . Questionnaire . QuestionnaireItemComponent child1 = createItem ( QuestionnaireItemType . GROUP ) ; resource . addItem ( child1 ) ; org . hl7 . fhir . dstu3 . model . Questionnaire . QuestionnaireItemEnableWhenComponent enableWhen = new org . hl7 . fhir . dstu3 . model . Questionnaire . QuestionnaireItemEnableWhenComponent ( ) ; enableWhen . setQuestion ( "q1" ) ; enableWhen . setHasAnswer ( true ) ; child1 . addEnableWhen ( enableWhen ) ; org . hl7 . fhir . dstu3 . model . Questionnaire . QuestionnaireItemComponent child21 = createItem ( QuestionnaireItemType . STRING ) ; child1 . addItem ( child21 ) ; java . lang . String inputXml = org . hl7 . fhir . dstu3 . hapi . validation . SchematronValidationDstu3QuestionnaireTest . ourCtx . newXmlParser ( ) . setPrettyPrint ( true ) . encodeResourceToString ( resource ) ; org . hl7 . fhir . dstu3 . hapi . validation . SchematronValidationDstu3QuestionnaireTest . ourLog . info ( inputXml ) ; ca . uhn . fhir . validation . ValidationResult result = validateSchematron ( resource ) ; "<AssertPlaceHolder>" ; } isSuccessful ( ) { return myIsSuccessful ; } | org . junit . Assert . assertTrue ( result . isSuccessful ( ) ) |
emptyPath ( ) { "<AssertPlaceHolder>" ; } getCellsOnPath ( jetbrains . jetpad . projectional . cell . mapping . Iterator ) { if ( sourcePath . hasNext ( ) ) { java . lang . Object actualSource = sourcePath . next ( ) ; return lookupCells ( actualSource , actualSource , sourcePath ) ; } else { return jetbrains . jetpad . projectional . cell . mapping . Collections . emptyList ( ) ; } } | org . junit . Assert . assertTrue ( provider . getCellsOnPath ( java . util . Collections . emptyList ( ) ) . isEmpty ( ) ) |
helpMeWithMyEmergency ( ) { org . drools . mas . helpers . SyncDialogueHelper helper = new org . drools . mas . helpers . SyncDialogueHelper ( endpoint ) ; org . drools . mas . examples . emergency . Emergency e = new org . drools . mas . examples . emergency . Emergency ( "SecondEmergency" , new org . drools . mas . Date ( ) , "Fire" , 10 ) ; helper . invokeInform ( "me" , "you" , e ) ; java . lang . String qid = helper . invokeQueryIf ( "me" , "you" , e ) ; java . lang . Object ret = helper . getReturn ( true ) ; "<AssertPlaceHolder>" ; java . lang . String rid = helper . invokeRequest ( "coordinateEmergency" , new org . drools . mas . LinkedHashMap < java . lang . String , java . lang . Object > ( ) ) ; java . lang . Object rAns = helper . getReturn ( true ) ; System . out . println ( rAns ) ; } getReturn ( boolean ) { if ( ( returnBody ) == null ) { return null ; } if ( decode ) { org . drools . mas . util . MessageContentEncoder . decodeBody ( returnBody , encode ) ; if ( ( returnBody ) instanceof org . drools . mas . body . acts . Inform ) { return ( ( org . drools . mas . body . acts . Inform ) ( returnBody ) ) . getProposition ( ) . getData ( ) ; } if ( ( returnBody ) instanceof org . drools . mas . body . acts . InformIf ) { return ( ( org . drools . mas . body . acts . InformIf ) ( returnBody ) ) . getProposition ( ) . getData ( ) ; } } else { if ( ( returnBody ) instanceof org . drools . mas . body . acts . Inform ) { return ( ( org . drools . mas . body . acts . Inform ) ( returnBody ) ) . getProposition ( ) . getEncodedContent ( ) ; } if ( ( returnBody ) instanceof org . drools . mas . body . acts . InformIf ) { return ( ( org . drools . mas . body . acts . InformIf ) ( returnBody ) ) . getProposition ( ) . getEncodedContent ( ) ; } } return returnBody ; } | org . junit . Assert . assertEquals ( e , ret ) |
testLegeActueel ( ) { final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Categorie < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3HuwelijkOfGpInhoud > actueel = maakHuwelijkOfGpRij ( null , null , null , null , null , null , null , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . AKTENUMMER , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . JUIST , 20100101 , 20100102 ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Categorie < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3HuwelijkOfGpInhoud > hist1 = maakHuwelijkOfGpRij ( nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . A_NUMMER , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . BSN , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . VOORNAMEN , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . GESLACHTSNAAM , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . DATUM_SLUITING , null , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HUWELIJK , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . AKTENUMMER , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . JUIST , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . DATUM_SLUITING , ( ( nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . DATUM_SLUITING ) + 1 ) ) ; final java . util . List < nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3HuwelijkOfGpInhoud > > huwelijkOfGpStapels = nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . HuwelijkOfGpConverteerderTest . maakHuwelijksStapels ( actueel , hist1 ) ; final nl . bzk . migratiebrp . conversie . model . tussen . TussenPersoonslijstBuilder builder = new nl . bzk . migratiebrp . conversie . model . tussen . TussenPersoonslijstBuilder ( ) ; huwelijkOfGpConverteerder . converteer ( huwelijkOfGpStapels , builder , null ) ; final java . util . List < nl . bzk . migratiebrp . conversie . model . tussen . TussenRelatie > relatieStapels = getMigratieRelaties ( builder ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , relatieStapels . size ( ) ) |
testInvertedTags ( ) { org . antlr . v4 . runtime . tree . pattern . ParseTreePatternMatcher m = new org . antlr . v4 . runtime . tree . pattern . ParseTreePatternMatcher ( null , null ) ; java . lang . String result = null ; try { m . split ( ">expr<" ) ; } catch ( java . lang . IllegalArgumentException iae ) { result = iae . getMessage ( ) ; } java . lang . String expected = "tag<sp>delimiters<sp>out<sp>of<sp>order<sp>in<sp>pattern:<sp>>expr<" ; "<AssertPlaceHolder>" ; } split ( java . lang . String ) { org . antlr . v4 . runtime . ANTLRInputStream in ; try { in = new org . antlr . v4 . runtime . ANTLRInputStream ( new java . io . StringReader ( path ) ) ; } catch ( java . io . IOException ioe ) { throw new java . lang . IllegalArgumentException ( ( "Could<sp>not<sp>read<sp>path:<sp>" + path ) , ioe ) ; } org . antlr . v4 . runtime . tree . xpath . XPathLexer lexer = new org . antlr . v4 . runtime . tree . xpath . XPathLexer ( in ) { @ org . antlr . v4 . runtime . tree . xpath . Override public void recover ( org . antlr . v4 . runtime . LexerNoViableAltException e ) { throw e ; } } ; lexer . removeErrorListeners ( ) ; lexer . addErrorListener ( new org . antlr . v4 . runtime . tree . xpath . XPathLexerErrorListener ( ) ) ; org . antlr . v4 . runtime . CommonTokenStream tokenStream = new org . antlr . v4 . runtime . CommonTokenStream ( lexer ) ; try { tokenStream . fill ( ) ; } catch ( org . antlr . v4 . runtime . LexerNoViableAltException e ) { int pos = lexer . getCharPositionInLine ( ) ; java . lang . String msg = ( ( ( "Invalid<sp>tokens<sp>or<sp>characters<sp>at<sp>index<sp>" + pos ) + "<sp>in<sp>path<sp>'" ) + path ) + "'" ; throw new java . lang . IllegalArgumentException ( msg , e ) ; } java . util . List < org . antlr . v4 . runtime . Token > tokens = tokenStream . getTokens ( ) ; java . util . List < org . antlr . v4 . runtime . tree . xpath . XPathElement > elements = new java . util . ArrayList < org . antlr . v4 . runtime . tree . xpath . XPathElement > ( ) ; int n = tokens . size ( ) ; int i = 0 ; loop : while ( i < n ) { org . antlr . v4 . runtime . Token el = tokens . get ( i ) ; org . antlr . v4 . runtime . Token next = null ; switch ( el . getType ( ) ) { case XPathLexer . ROOT : case XPathLexer . ANYWHERE : boolean anywhere = ( el . getType ( ) ) == ( XPathLexer . ANYWHERE ) ; i ++ ; next = tokens . get ( i ) ; boolean invert = ( next . getType ( ) ) == ( XPathLexer . BANG ) ; if ( invert ) { i ++ ; next = tokens . get ( i ) ; } org . antlr . v4 . runtime . tree . xpath . XPathElement pathElement = getXPathElement ( next , anywhere ) ; pathElement . invert = invert ; elements . add ( pathElement ) ; i ++ ; break ; case XPathLexer . TOKEN_REF : case XPathLexer . RULE_REF : case XPathLexer . WILDCARD : elements . add ( getXPathElement ( el , false ) ) ; i ++ ; break ; case org . antlr . v4 . runtime . Token . EOF : break loop ; default : throw new java . lang . IllegalArgumentException ( ( "Unknowth<sp>path<sp>element<sp>" + el ) ) ; } } return elements . toArray ( new org . antlr . v4 . runtime . tree . xpath . XPathElement [ 0 ] ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testStringEqual ( ) { executeWithDefaultScope ( "boolVar<sp>=<sp>'string'<sp>==<sp>'string'" ) ; "<AssertPlaceHolder>" ; } getBoolValue ( ) { return context . getVariable ( "boolVar" ) . getValue ( ) ; } | org . junit . Assert . assertEquals ( true , getBoolValue ( ) ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . ResourceAction newResourceAction = addResourceAction ( ) ; com . liferay . portal . kernel . model . ResourceAction existingResourceAction = _persistence . findByPrimaryKey ( newResourceAction . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingResourceAction , newResourceAction ) |
testStyleUsageCount ( ) { try { org . odftoolkit . odfdom . incubator . doc . office . OdfOfficeAutomaticStyles s = odfdoc . getStylesDom ( ) . getAutomaticStyles ( ) ; org . odftoolkit . odfdom . incubator . doc . style . OdfStyle pr1 = s . getStyle ( "pr1" , OdfStyleFamily . Presentation ) ; int styleUserCount = pr1 . getStyleUserCount ( ) ; org . odftoolkit . odfdom . dom . OdfStylesDom stylesDom = odfdoc . getStylesDom ( ) ; javax . xml . xpath . XPath xpath = stylesDom . getXPath ( ) ; org . w3c . dom . NodeList elementsWithStyle = ( ( org . w3c . dom . NodeList ) ( xpath . evaluate ( "//draw:frame[@presentation:style-name='pr1']" , stylesDom , XPathConstants . NODESET ) ) ) ; int elementsWithStyleCount = elementsWithStyle . getLength ( ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { java . util . logging . Logger . getLogger ( org . odftoolkit . simple . PresentationTest . class . getName ( ) ) . log ( Level . SEVERE , e . getMessage ( ) , e ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getLength ( ) { return attributes . getLength ( ) ; } | org . junit . Assert . assertTrue ( ( styleUserCount == elementsWithStyleCount ) ) |
testMultilinePre ( ) { java . lang . String content = "previous<sp>line\n<sp>monospace\n<sp>second<sp>line\nnext<sp>line" ; java . lang . String expected = "previous<sp>line\n{{{\n<sp>monospace\n<sp>second<sp>line\n}}}\nnext<sp>line" ; java . lang . String actual = _translate ( content ) ; "<AssertPlaceHolder>" ; } _translate ( com . liferay . portal . kernel . exception . PortalException ) { if ( portalException instanceof com . liferay . dynamic . data . mapping . exception . StorageFieldRequiredException ) { return new com . liferay . dynamic . data . mapping . kernel . StorageFieldRequiredException ( portalException . getMessage ( ) , portalException . getCause ( ) ) ; } return portalException ; } | org . junit . Assert . assertEquals ( expected , actual ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.