input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testReadDouble ( ) { java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . allocate ( ( ( com . liferay . portal . kernel . io . DeserializerTest . _COUNT ) * 8 ) ) ; byteBuffer . order ( ByteOrder . BIG_ENDIAN ) ; java . nio . DoubleBuffer doubleBuffer = byteBuffer . asDoubleBuffer ( ) ; double [ ] doubles = new double [ com . liferay . portal . kernel . io . DeserializerTest . _COUNT ] ; for ( int i = 0 ; i < ( com . liferay . portal . kernel . io . DeserializerTest . _COUNT ) ; i ++ ) { doubles [ i ] = _random . nextDouble ( ) ; doubleBuffer . put ( doubles [ i ] ) ; } com . liferay . portal . kernel . io . Deserializer deserializer = new com . liferay . portal . kernel . io . Deserializer ( byteBuffer ) ; for ( int i = 0 ; i < ( com . liferay . portal . kernel . io . DeserializerTest . _COUNT ) ; i ++ ) { "<AssertPlaceHolder>" ; } } readDouble ( ) { _detectBufferUnderflow ( 8 ) ; double d = com . liferay . petra . io . BigEndianCodec . getDouble ( _buffer , _index ) ; _index += 8 ; return d ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Double ) ( doubles [ i ] ) ) , ( ( java . lang . Double ) ( deserializer . readDouble ( ) ) ) )
testEncryptDecrypt ( ) { final java . lang . String unencryptedPassword = "protect" ; ddf . security . encryption . impl . EncryptionServiceImplTest . LOGGER . debug ( "Unencrypted<sp>Password:<sp>{}" , unencryptedPassword ) ; final ddf . security . encryption . impl . EncryptionServiceImpl encryptionService = new ddf . security . encryption . impl . EncryptionServiceImpl ( ) ; final java . lang . String encryptedPassword = encryptionService . encrypt ( unencryptedPassword ) ; ddf . security . encryption . impl . EncryptionServiceImplTest . LOGGER . debug ( "Encrypted<sp>Password:<sp>{}" , encryptedPassword ) ; final java . lang . String decryptedPassword = encryptionService . decrypt ( encryptedPassword ) ; ddf . security . encryption . impl . EncryptionServiceImplTest . LOGGER . debug ( "Decrypted<sp>Password:<sp>{}" , decryptedPassword ) ; "<AssertPlaceHolder>" ; } decrypt ( java . lang . String ) { if ( ( initFailureMessage ) != null ) { alertSystem ( initFailureMessage , initException ) ; } if ( isBlank ( encryptedValue ) ) { org . codice . felix . cm . file . EncryptingPersistenceManager . LOGGER . debug ( "Failed<sp>to<sp>decrypt<sp>value<sp>of<sp>{},<sp>because<sp>it<sp>was<sp>null<sp>or<sp>blank." , encryptedValue ) ; return encryptedValue ; } try { return crypter . decrypt ( encryptedValue ) ; } catch ( ddf . security . encryption . crypter . Crypter . CrypterException e ) { org . codice . felix . cm . file . EncryptingPersistenceManager . LOGGER . warn ( "Failed<sp>to<sp>decrypt<sp>from<sp>bundle<sp>cache.<sp>{}" , e . getMessage ( ) ) ; return encryptedValue ; } }
org . junit . Assert . assertEquals ( unencryptedPassword , decryptedPassword )
testConstructorWithInvalidSuite ( ) { try { new com . codeaffine . osgi . testuite . BundleTestSuite ( com . codeaffine . osgi . testuite . BundleTestSuiteTest . InvalidBundleTestSuite . class ) ; org . junit . Assert . fail ( ) ; } catch ( org . junit . runners . model . InitializationError expected ) { java . lang . String message = expected . getCauses ( ) . get ( 0 ) . getMessage ( ) ; "<AssertPlaceHolder>" ; } }
org . junit . Assert . assertTrue ( message . contains ( com . codeaffine . osgi . testuite . BundleTestSuiteTest . InvalidBundleTestSuite . class . getName ( ) ) )
apiDeleteProductTest ( ) { java . util . Map product = wooCommerce . delete ( EndpointBaseType . PRODUCTS . getValue ( ) , 10 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertNotNull ( product )
testInterpolateString ( ) { java . util . Properties prop = new java . util . Properties ( ) ; prop . setProperty ( "key" , "value" ) ; prop . setProperty ( "nested" , "nested<sp>${key}" ) ; java . lang . String text = "This<sp>is<sp>a<sp>test<sp>of<sp>'${key}'<sp>'${nested}'" ; java . lang . String expResults = "This<sp>is<sp>a<sp>test<sp>of<sp>'value'<sp>'nested<sp>value'" ; java . lang . String results = org . owasp . dependencycheck . xml . pom . Model . interpolateString ( text , prop ) ; "<AssertPlaceHolder>" ; } interpolateString ( java . lang . String , java . util . Properties ) { if ( ( null == text ) || ( null == properties ) ) { return text ; } final org . apache . commons . text . StringSubstitutor substitutor = new org . apache . commons . text . StringSubstitutor ( new org . owasp . dependencycheck . xml . pom . Model . PropertyLookup ( properties ) ) ; return substitutor . replace ( text ) ; }
org . junit . Assert . assertEquals ( expResults , results )
testLinspace1 ( ) { org . nd4j . linalg . api . ndarray . INDArray z1 = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 100 , 200 ) ; org . nd4j . linalg . rng . Linspace linspace = new org . nd4j . linalg . rng . Linspace ( 1 , 100 , 200 ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( linspace , org . nd4j . linalg . factory . Nd4j . getRandom ( ) ) ; org . nd4j . linalg . api . ndarray . INDArray z2 = linspace . z ( ) ; "<AssertPlaceHolder>" ; } z ( ) { if ( ( z ) == null ) { if ( ( sameDiff ) != null ) { this . z = outputVariables ( ) [ 0 ] . getArr ( ) ; if ( ( this . z ) == null ) { lombok . val var = outputVariables ( ) [ 0 ] ; if ( ( var . getShape ( ) ) != null ) this . z = var . storeAndAllocateNewArray ( ) ; else { lombok . val argsShape = args ( ) [ 0 ] . getShape ( ) ; if ( argsShape != null ) { sameDiff . putShapeForVarName ( var . getVarName ( ) , argsShape ) ; this . z = var . storeAndAllocateNewArray ( ) ; } } } } } return z ; }
org . junit . Assert . assertEquals ( z1 , z2 )
testGetTotalConnectionSize ( ) { io . cloudslang . content . database . services . dbconnection . DBConnectionManager dbcManagerSpy = getDBConnectionManagerSpyWithPooling ( ) ; dbcManagerSpy . dbmsPoolTable = getHashTableObject3 ( ) ; java . util . Hashtable < java . lang . String , io . cloudslang . content . database . services . dbconnection . PooledDataSourceProvider > providerTableMock = mock ( java . util . Hashtable . class ) ; io . cloudslang . content . database . services . dbconnection . PooledDataSourceProvider providerMock = mock ( io . cloudslang . content . database . services . dbconnection . PooledDataSourceProvider . class ) ; doReturn ( 10 ) . when ( providerMock ) . getAllConnectionNumber ( any ( javax . sql . DataSource . class ) ) ; doReturn ( providerMock ) . when ( providerTableMock ) . get ( anyString ( ) ) ; dbcManagerSpy . providerTable = providerTableMock ; "<AssertPlaceHolder>" ; verifyNumberOfInvocationsOnMockObjects ( providerTableMock , providerMock ) ; } getTotalConnectionSize ( ) { int retTotal = 0 ; io . cloudslang . content . database . services . dbconnection . Enumeration < java . lang . String > allDbmsKeys = dbmsPoolTable . keys ( ) ; while ( allDbmsKeys . hasMoreElements ( ) ) { java . lang . String dbmsPoolKey = allDbmsKeys . nextElement ( ) ; io . cloudslang . content . database . services . dbconnection . Hashtable < java . lang . String , javax . sql . DataSource > dsTable = dbmsPoolTable . get ( dbmsPoolKey ) ; io . cloudslang . content . database . services . dbconnection . PooledDataSourceProvider provider = this . getProvider ( dbmsPoolKey ) ; if ( dsTable != null ) { for ( javax . sql . DataSource ds : dsTable . values ( ) ) { retTotal = retTotal + ( provider . getAllConnectionNumber ( ds ) ) ; } } } return retTotal ; }
org . junit . Assert . assertEquals ( 10 , dbcManagerSpy . getTotalConnectionSize ( ) )
testSaml2TokenHOK ( ) { org . apache . cxf . service . Service service = createService ( ) ; java . util . Map < java . lang . String , java . lang . Object > inProperties = new java . util . HashMap ( ) ; inProperties . put ( ConfigurationConstants . ACTION , ( ( ( org . apache . wss4j . common . ConfigurationConstants . SAML_TOKEN_SIGNED ) + "<sp>" ) + ( org . apache . wss4j . common . ConfigurationConstants . SIGNATURE ) ) ) ; inProperties . put ( ConfigurationConstants . SIG_VER_PROP_FILE , "insecurity.properties" ) ; final java . util . Map < javax . xml . namespace . QName , java . lang . Object > customMap = new java . util . HashMap ( ) ; org . apache . cxf . ws . security . wss4j . saml . CustomSamlValidator validator = new org . apache . cxf . ws . security . wss4j . saml . CustomSamlValidator ( ) ; customMap . put ( WSConstants . SAML_TOKEN , validator ) ; customMap . put ( WSConstants . SAML2_TOKEN , validator ) ; inProperties . put ( WSS4JInInterceptor . VALIDATOR_MAP , customMap ) ; org . apache . cxf . ws . security . wss4j . WSS4JInInterceptor inInterceptor = new org . apache . cxf . ws . security . wss4j . WSS4JInInterceptor ( inProperties ) ; service . getInInterceptors ( ) . add ( inInterceptor ) ; org . apache . cxf . ws . security . wss4j . Echo echo = createClientProxy ( ) ; org . apache . cxf . endpoint . Client client = org . apache . cxf . frontend . ClientProxy . getClient ( echo ) ; client . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; client . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties properties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; java . util . List < org . apache . wss4j . stax . ext . WSSConstants . Action > actions = new java . util . ArrayList ( ) ; actions . add ( WSSConstants . SAML_TOKEN_SIGNED ) ; properties . setActions ( actions ) ; org . apache . cxf . ws . security . wss4j . saml . SAML2CallbackHandler callbackHandler = new org . apache . cxf . ws . security . wss4j . saml . SAML2CallbackHandler ( ) ; callbackHandler . setSignAssertion ( true ) ; callbackHandler . setConfirmationMethod ( SAML2Constants . CONF_HOLDER_KEY ) ; properties . setSamlCallbackHandler ( callbackHandler ) ; properties . setCallbackHandler ( new org . apache . cxf . ws . security . wss4j . saml . PasswordCallbackHandler ( ) ) ; properties . setSignatureUser ( "alice" ) ; java . util . Properties cryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "alice.properties" , this . getClass ( ) . getClassLoader ( ) ) ; properties . setSignatureCryptoProperties ( cryptoProperties ) ; properties . setSignatureKeyIdentifier ( WSSecurityTokenConstants . KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ohandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ( properties ) ; client . getOutInterceptors ( ) . add ( ohandler ) ; try { echo . echo ( "test" ) ; org . junit . Assert . fail ( "Failure<sp>expected<sp>on<sp>receiving<sp>sender<sp>vouches<sp>instead<sp>of<sp>HOK" ) ; } catch ( org . apache . cxf . ws . security . wss4j . saml . javax ex ) { } validator . setRequireSenderVouches ( false ) ; try { echo . echo ( "test" ) ; org . junit . Assert . fail ( "Failure<sp>expected<sp>on<sp>receiving<sp>a<sp>SAML<sp>1.1<sp>Token<sp>instead<sp>of<sp>SAML<sp>2.0" ) ; } catch ( org . apache . cxf . ws . security . wss4j . saml . javax ex ) { } validator . setRequireSAML1Assertion ( false ) ; "<AssertPlaceHolder>" ; } echo ( int ) { return i ; }
org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) )
simpleTextReplacement ( ) { com . atlassian . plugins . codegen . modules . PluginModuleProperties props = new com . atlassian . plugins . codegen . modules . BasicClassModuleProperties ( ) ; java . lang . String expected = "i.work" ; props . setProperty ( "PACKAGE_NAME" , expected ) ; com . atlassian . plugins . codegen . util . CodeTemplateHelper templateHelper = new com . atlassian . plugins . codegen . util . CodeTemplateHelper ( ) ; java . lang . String parsedTemplate = templateHelper . parseTemplate ( "templates/simple/Simple.java.vtl" , props ) ; "<AssertPlaceHolder>" ; } parseTemplate ( java . lang . String , java . util . Map ) { org . apache . velocity . VelocityContext ctx = new org . apache . velocity . VelocityContext ( ) ; ctx . put ( "parseCheck" , new com . atlassian . plugins . codegen . util . CodeTemplateHelper . TemplateChecker ( ) ) ; for ( Map . Entry < java . lang . Object , java . lang . Object > entry : props . entrySet ( ) ) { ctx . put ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) ) ; } final java . io . StringWriter stringWriter = new java . io . StringWriter ( ) ; org . apache . velocity . Template template = org . apache . velocity . app . Velocity . getTemplate ( templatePath ) ; template . merge ( ctx , stringWriter ) ; return stringWriter . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , parsedTemplate )
testToDbTokensCompare ( ) { java . util . List < org . apache . cayenne . dbsync . merge . token . MergerToken > tokens = java . util . Arrays . < org . apache . cayenne . dbsync . merge . token . MergerToken > asList ( new org . apache . cayenne . dbsync . merge . token . db . DropColumnToDb ( null , null ) , new org . apache . cayenne . dbsync . merge . token . db . DropRelationshipToDb ( null , null ) , new org . apache . cayenne . dbsync . merge . token . db . DropTableToDb ( null ) , new org . apache . cayenne . dbsync . merge . token . model . AddColumnToModel ( null , null ) , new org . apache . cayenne . dbsync . merge . token . db . AddRelationshipToDb ( null , null ) , new org . apache . cayenne . dbsync . merge . token . db . AddColumnToDb ( null , null ) , new org . apache . cayenne . dbsync . merge . token . db . CreateTableToDb ( null ) ) ; java . util . Collections . sort ( tokens ) ; java . util . List < java . lang . String > actual = toClassesNames ( tokens ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "DropRelationshipToDb" , "DropColumnToDb" , "DropTableToDb" , "CreateTableToDb" , "AddColumnToDb" , "AddColumnToModel" , "AddRelationshipToDb" ) ; "<AssertPlaceHolder>" ; } toClassesNames ( java . util . List ) { java . util . List < java . lang . String > res = new java . util . ArrayList < java . lang . String > ( sort . size ( ) ) ; for ( org . apache . cayenne . dbsync . merge . token . MergerToken mergerToken : sort ) { res . add ( mergerToken . getClass ( ) . getSimpleName ( ) ) ; } return res ; }
org . junit . Assert . assertEquals ( expected , actual )
runInTransactionShouldThrowIfDatastoreNewTransactionFails ( ) { com . spotify . styx . storage . CheckedDatastore datastore = mock ( com . spotify . styx . storage . CheckedDatastore . class ) ; final com . spotify . styx . storage . DatastoreStorage storage = new com . spotify . styx . storage . DatastoreStorage ( datastore , java . time . Duration . ZERO , storageTransactionFactory , executor ) ; when ( datastore . newTransaction ( ) ) . thenThrow ( new com . spotify . styx . storage . DatastoreIOException ( new com . google . cloud . datastore . DatastoreException ( 1 , "" , "" ) ) ) ; when ( transactionFunction . apply ( any ( ) ) ) . thenReturn ( "" ) ; try { storage . runInTransaction ( transactionFunction ) ; org . junit . Assert . fail ( "Expected<sp>exception!" ) ; } catch ( com . spotify . styx . storage . TransactionException e ) { "<AssertPlaceHolder>" ; } verify ( transactionFunction , never ( ) ) . apply ( any ( ) ) ; } isConflict ( ) { if ( ( ( getCause ( ) ) != null ) && ( ( getCause ( ) ) instanceof com . google . cloud . datastore . DatastoreException ) ) { com . google . cloud . datastore . DatastoreException datastoreException = ( ( com . google . cloud . datastore . DatastoreException ) ( getCause ( ) ) ) ; return ( datastoreException . getCode ( ) ) == 10 ; } else { return false ; } }
org . junit . Assert . assertFalse ( e . isConflict ( ) )
getSetCreated ( ) { java . util . Date expected = new java . util . Date ( ) ; com . microsoft . windowsazure . services . media . models . AccessPolicyInfo policy = new com . microsoft . windowsazure . services . media . models . AccessPolicyInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . AccessPolicyType ( ) . setCreated ( expected ) ) ; java . util . Date actual = policy . getCreated ( ) ; "<AssertPlaceHolder>" ; } getCreated ( ) { return created ; }
org . junit . Assert . assertEquals ( expected , actual )
testWeirdConvImport ( ) { lombok . val tg = org . nd4j . imports . graphmapper . tf . TFGraphMapper . getInstance ( ) . importGraph ( new java . io . File ( "/home/agibsonccc/code/raver_tfimport_test1/profiling_conv.pb.txt" ) ) ; "<AssertPlaceHolder>" ; } importGraph ( org . nd4j . imports . graphmapper . InputStream ) { return importGraph ( inputStream , org . nd4j . imports . graphmapper . Collections . < java . lang . String , org . nd4j . imports . graphmapper . OpImportOverride < GRAPH_TYPE , NODE_TYPE , ATTR_TYPE > > emptyMap ( ) , null ) ; }
org . junit . Assert . assertNotNull ( tg )
test40getPoliciesByResourceSignature ( ) { java . util . List < org . apache . ranger . plugin . model . RangerPolicy > rangerPolicyLists = new java . util . ArrayList < org . apache . ranger . plugin . model . RangerPolicy > ( ) ; org . apache . ranger . plugin . model . RangerPolicy rangerPolicy = rangerPolicy ( ) ; rangerPolicyLists . add ( rangerPolicy ) ; java . lang . String serviceName = "HDFS_1" ; java . lang . String policySignature = "Repo" ; java . lang . Boolean isPolicyEnabled = true ; org . apache . ranger . plugin . model . RangerService rangerService = rangerService ( ) ; java . util . List < org . apache . ranger . biz . XXPolicy > policiesList = new java . util . ArrayList < org . apache . ranger . biz . XXPolicy > ( ) ; org . apache . ranger . biz . XXPolicy policy = new org . apache . ranger . biz . XXPolicy ( ) ; policy . setAddedByUserId ( org . apache . ranger . biz . TestServiceDBStore . Id ) ; policy . setCreateTime ( new java . util . Date ( ) ) ; policy . setDescription ( "polcy<sp>test" ) ; policy . setGuid ( "" ) ; policy . setId ( rangerService . getId ( ) ) ; policy . setIsAuditEnabled ( true ) ; policy . setName ( "HDFS_1-1-20150316062453" ) ; policy . setService ( rangerService . getId ( ) ) ; policiesList . add ( policy ) ; org . apache . ranger . biz . XXPolicyDao xPolicyDao = org . mockito . Mockito . mock ( org . apache . ranger . biz . XXPolicyDao . class ) ; org . mockito . Mockito . when ( daoManager . getXXPolicy ( ) ) . thenReturn ( xPolicyDao ) ; org . mockito . Mockito . when ( xPolicyDao . findByResourceSignatureByPolicyStatus ( serviceName , policySignature , isPolicyEnabled ) ) . thenReturn ( policiesList ) ; java . util . List < org . apache . ranger . plugin . model . RangerPolicy > policyList = serviceDBStore . getPoliciesByResourceSignature ( serviceName , policySignature , isPolicyEnabled ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( daoManager ) . getXXPolicy ( ) ; } getPoliciesByResourceSignature ( java . lang . String , java . lang . String , java . lang . Boolean ) { java . util . List < org . apache . ranger . biz . XXPolicy > xxPolicies = daoMgr . getXXPolicy ( ) . findByResourceSignatureByPolicyStatus ( serviceName , policySignature , isPolicyEnabled ) ; java . util . List < org . apache . ranger . plugin . model . RangerPolicy > policies = new java . util . ArrayList < org . apache . ranger . plugin . model . RangerPolicy > ( xxPolicies . size ( ) ) ; for ( org . apache . ranger . biz . XXPolicy xxPolicy : xxPolicies ) { org . apache . ranger . plugin . model . RangerPolicy policy = policyService . getPopulatedViewObject ( xxPolicy ) ; policies . add ( policy ) ; } return policies ; }
org . junit . Assert . assertNotNull ( policyList )
testExecute ( ) { com . ctrip . platform . dal . dao . task . SingleInsertTask < com . ctrip . platform . dal . dao . task . ClientTestModel > test = new com . ctrip . platform . dal . dao . task . SingleInsertTask ( ) ; test . initialize ( getParser ( ) ) ; com . ctrip . platform . dal . dao . DalHints hints = new com . ctrip . platform . dal . dao . DalHints ( ) ; try { int result = test . execute ( hints , getAllMap ( ) . get ( 0 ) , null , new com . ctrip . platform . dal . dao . task . DefaultTaskContext ( ) ) ; "<AssertPlaceHolder>" ; } catch ( java . sql . SQLException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } } getCount ( ) { return getAllMap ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( ( 3 + 1 ) , getCount ( ) )
testRestorationFromAutomationOperation ( ) { java . util . List < org . nuxeo . ecm . platform . audit . api . LogEntry > entries = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { entries . add ( org . nuxeo . elasticsearch . LogEntryGen . doCreateEntry ( "mydoc" , "evt" , "cat" ) ) ; } jpaBackend . addLogEntries ( entries ) ; txFeature . nextTransaction ( ) ; org . nuxeo . ecm . automation . OperationContext ctx = new org . nuxeo . ecm . automation . OperationContext ( session ) ; java . util . Map < java . lang . String , java . io . Serializable > params = new java . util . HashMap ( ) ; params . put ( "auditStorage" , org . nuxeo . elasticsearch . TestAuditMigration . DEFAULT_AUDIT_STORAGE ) ; automationService . run ( ctx , AuditRestore . ID , params ) ; org . nuxeo . elasticsearch . LogEntryGen . flushAndSync ( ) ; org . nuxeo . elasticsearch . audit . ESAuditBackend esBackend = ( ( org . nuxeo . elasticsearch . audit . ESAuditBackend ) ( org . nuxeo . runtime . api . Framework . getService ( org . nuxeo . ecm . platform . audit . service . AuditBackend . class ) ) ) ; java . util . List < org . nuxeo . ecm . platform . audit . api . LogEntry > migratedEntries = esBackend . queryLogs ( new org . nuxeo . ecm . platform . audit . api . AuditQueryBuilder ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 1000 , migratedEntries . size ( ) )
testSetJmx ( ) { org . jacoco . core . runtime . AgentOptions options = new org . jacoco . core . runtime . AgentOptions ( ) ; options . setJmx ( true ) ; "<AssertPlaceHolder>" ; } getJmx ( ) { return getOption ( org . jacoco . core . runtime . AgentOptions . JMX , false ) ; }
org . junit . Assert . assertTrue ( options . getJmx ( ) )
testHandleGetRequest ( ) { com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; com . fasterxml . jackson . databind . node . ObjectNode node = mapper . createObjectNode ( ) ; expect ( restconfService . runGetOperationOnDataResource ( java . net . URI . create ( ( ( getBaseUri ( ) ) + ( org . onosproject . protocol . restconf . server . rpp . RestconfWebResourceTest . DATA_IETF_SYSTEM_SYSTEM ) ) ) ) ) . andReturn ( node ) . anyTimes ( ) ; replay ( restconfService ) ; javax . ws . rs . client . WebTarget wt = target ( ) ; java . lang . String response = wt . path ( ( "/" + ( org . onosproject . protocol . restconf . server . rpp . RestconfWebResourceTest . DATA_IETF_SYSTEM_SYSTEM ) ) ) . request ( ) . get ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return sendRequest ( request ) ; }
org . junit . Assert . assertNotNull ( response )
testOnEnderChestOpenNotRightClick ( ) { action = org . bukkit . event . block . Action . LEFT_CLICK_AIR ; org . bukkit . block . BlockFace clickedBlockFace = org . bukkit . block . BlockFace . EAST ; org . bukkit . event . player . PlayerInteractEvent e = new org . bukkit . event . player . PlayerInteractEvent ( player , action , item , clickedBlock , clickedBlockFace ) ; new world . bentobox . bentobox . listeners . flags . protection . BlockInteractionListener ( ) . onPlayerInteract ( e ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return cancelled ; }
org . junit . Assert . assertFalse ( e . isCancelled ( ) )
testGetValue ( ) { org . jinstagram . auth . model . Verifier fixture = new org . jinstagram . auth . model . Verifier ( "verifierCode" ) ; java . lang . String result = fixture . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( "verifierCode" , result )
hamcrest_core_is ( ) { java . lang . String isLite = "Miller<sp>Brewing<sp>Company" ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( "Miller<sp>Brewing<sp>Company" , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( isLite ) ) )
testGetNumResolutions ( ) { "<AssertPlaceHolder>" ; } getNumResolutions ( ) { return numResolutions ; }
org . junit . Assert . assertEquals ( 3 , instance . getNumResolutions ( ) )
getDocumentByIdTest ( ) { final org . bonitasoft . engine . core . document . model . SMappedDocument sDocument = createDocumentMapping ( ) ; final org . bonitasoft . engine . core . document . model . SMappedDocument result = getDocumentMapping ( sDocument ) ; "<AssertPlaceHolder>" ; delete ( result ) ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( sDocument . getId ( ) , result . getId ( ) )
getAndSetId ( ) { final int newId = 2 ; customer . setId ( newId ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( newId , customer . getId ( ) )
testGetHeaders ( ) { gov . hhs . fha . nhinc . callback . SOAPHeaderHandler soapHeaderHandler = new gov . hhs . fha . nhinc . callback . SOAPHeaderHandler ( ) ; java . util . Set < javax . xml . namespace . QName > header = soapHeaderHandler . getHeaders ( ) ; "<AssertPlaceHolder>" ; } getHeaders ( ) { java . util . Set < javax . xml . namespace . QName > headers = new java . util . HashSet ( ) ; headers . add ( gov . hhs . fha . nhinc . logging . transaction . TransactionHandler . TRANSACTION_QNAME ) ; return headers ; }
org . junit . Assert . assertTrue ( header . isEmpty ( ) )
doAnyCustomersLiveInLondon ( ) { boolean anyCustomersFromLondon = false ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( anyCustomersFromLondon )
getLoadedPaths ( ) { classLoader . addPath ( "src/test/resources/commons-beanutils-1.8.3.jar" ) ; java . util . Set set = new java . util . HashSet ( java . util . Arrays . asList ( new java . io . File ( "src/test/resources/commons-beanutils-1.8.3.jar" ) . toURL ( ) ) ) ; "<AssertPlaceHolder>" ; } getLoadedPaths ( ) { return loadedPaths ; }
org . junit . Assert . assertEquals ( set , classLoader . getLoadedPaths ( ) )
getDriverClassName ( ) { "<AssertPlaceHolder>" ; } getDriverClassName ( ) { org . junit . Assert . assertEquals ( "net.sourceforge.jtds.jdbc.Driver" , instance . getDriverClassName ( ) ) ; }
org . junit . Assert . assertEquals ( "net.sourceforge.jtds.jdbc.Driver" , instance . getDriverClassName ( ) )
getUsersByName_shouldNotFetchAnyVoidedUsersWhenIncludeVoidedIsFalse ( ) { org . openmrs . User voidedUser = userService . getUser ( 501 ) ; java . util . List < org . openmrs . User > users = userService . getUsersByName ( "Bruno" , "Otterbourg" , false ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return getSession ( ) . contains ( object ) ; }
org . junit . Assert . assertFalse ( users . contains ( voidedUser ) )
panopticOperationsHandlerSetUgiException ( ) { java . lang . String user = "user" ; java . util . List < java . lang . String > groups = com . google . common . collect . Lists . newArrayList ( ) ; when ( primaryDatabaseClient . set_ugi ( user , groups ) ) . thenThrow ( new org . apache . thrift . TException ( ) ) ; com . hotels . bdp . waggledance . mapping . service . PanopticOperationHandler handler = service . getPanopticOperationHandler ( ) ; java . util . List < com . hotels . bdp . waggledance . mapping . model . DatabaseMapping > databaseMappings = service . getDatabaseMappings ( ) ; java . util . List < java . lang . String > result = handler . setUgi ( user , groups , databaseMappings ) ; "<AssertPlaceHolder>" ; } size ( ) { return whiteList . size ( ) ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
testImageNotUpdatedWhenUpdatingBlogsEntryWithNullImageSelector ( ) { com . liferay . blogs . model . BlogsEntry blogsEntry = addBlogsEntry ( "image1.jpg" ) ; com . liferay . portal . kernel . repository . model . FileEntry imageFileEntry = com . liferay . portal . kernel . portletfilerepository . PortletFileRepositoryUtil . getPortletFileEntry ( getImageFileEntryId ( blogsEntry ) ) ; com . liferay . portal . kernel . servlet . taglib . ui . ImageSelector imageSelector = null ; blogsEntry = updateBlogsEntry ( blogsEntry . getEntryId ( ) , imageSelector ) ; "<AssertPlaceHolder>" ; com . liferay . portal . kernel . portletfilerepository . PortletFileRepositoryUtil . getPortletFileEntry ( imageFileEntry . getFileEntryId ( ) ) ; } getFileEntryId ( ) { return com . liferay . upload . web . internal . HTMLImageAttachmentElementReplacerTest . _IMAGE_FILE_ENTRY_ID ; }
org . junit . Assert . assertEquals ( imageFileEntry . getFileEntryId ( ) , getImageFileEntryId ( blogsEntry ) )
should_generate ( ) { net . rrm . ehour . report . criteria . ReportCriteria criteria = net . rrm . ehour . ui . report . detailed . DetailedReportDataObjectMother . getReportCriteria ( ) ; when ( detailedReportService . getDetailedReportData ( criteria ) ) . thenReturn ( net . rrm . ehour . ui . report . detailed . DetailedReportDataObjectMother . getFlatReportData ( ) ) ; java . io . ByteArrayOutputStream stream = new java . io . ByteArrayOutputStream ( ) ; new net . rrm . ehour . ui . report . detailed . DetailedReportExcel ( new net . rrm . ehour . ui . common . wicket . Model < net . rrm . ehour . report . criteria . ReportCriteria > ( criteria ) ) . write ( stream ) ; byte [ ] excelData = stream . toByteArray ( ) ; "<AssertPlaceHolder>" ; } write ( java . io . OutputStream ) { net . rrm . ehour . ui . common . panel . entryselector . EntrySelectorExcelGenerator excelGenerator = new net . rrm . ehour . ui . common . panel . entryselector . EntrySelectorExcelGenerator ( ) ; net . rrm . ehour . ui . common . report . excel . ExcelWorkbook workbook = excelGenerator . create ( getPanelModelObject ( ) , "Export" ) ; workbook . write ( stream ) ; }
org . junit . Assert . assertTrue ( ( ( excelData . length ) > 0 ) )
testBuildCityDisplayNameWithCityWithoutZipCode ( ) { com . gisgraphy . webapp . action . GeocodingAction action = new com . gisgraphy . webapp . action . GeocodingAction ( ) ; com . gisgraphy . fulltext . SolrResponseDto cityFound1 = org . easymock . EasyMock . createMock ( com . gisgraphy . fulltext . SolrResponseDto . class ) ; org . easymock . EasyMock . expect ( cityFound1 . getLat ( ) ) . andStubReturn ( 23.0 ) ; org . easymock . EasyMock . expect ( cityFound1 . getLng ( ) ) . andStubReturn ( 30.0 ) ; java . lang . String cityNameFound = "cityName" ; org . easymock . EasyMock . expect ( cityFound1 . getName ( ) ) . andStubReturn ( cityNameFound ) ; java . util . Set < java . lang . String > zipCodes = new java . util . HashSet < java . lang . String > ( ) ; org . easymock . EasyMock . expect ( cityFound1 . getZipcodes ( ) ) . andStubReturn ( zipCodes ) ; org . easymock . EasyMock . replay ( cityFound1 ) ; java . lang . String displayName = action . buildCityDisplayName ( cityFound1 ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( cityFound1 . getName ( ) , displayName )
shouldReturnActiveRMUrlWhenConnectingToStandby ( ) { java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap ( ) ; map . put ( "yarn.resourcemanager.url" , ( ( ( org . apache . ambari . view . utils . ambari . ServicesTest . HTTP_RM_URL1 ) + ",<sp>" ) + ( org . apache . ambari . view . utils . ambari . ServicesTest . HTTP_RM_URL2 ) ) ) ; org . apache . ambari . view . ViewContext viewContext = getViewContext ( map ) ; org . apache . ambari . view . utils . ambari . AmbariApi ambariApi = createNiceMock ( org . apache . ambari . view . utils . ambari . AmbariApi . class ) ; org . apache . ambari . view . URLStreamProvider urlStreamProvider = createNiceMock ( org . apache . ambari . view . URLStreamProvider . class ) ; java . io . InputStream inputStream = org . apache . commons . io . IOUtils . toInputStream ( "{\"clusterInfo\":<sp>{\"haState\":<sp>\"STANDBY\"}}" ) ; expect ( ambariApi . isClusterAssociated ( ) ) . andReturn ( false ) ; expect ( viewContext . getURLStreamProvider ( ) ) . andReturn ( urlStreamProvider ) . anyTimes ( ) ; expect ( urlStreamProvider . readFrom ( eq ( ( ( org . apache . ambari . view . utils . ambari . ServicesTest . HTTP_RM_URL1 ) + ( org . apache . ambari . view . utils . ambari . ServicesTest . RM_INFO_API_ENDPOINT ) ) ) , eq ( "GET" ) , anyString ( ) , org . easymock . EasyMock . < java . util . Map < java . lang . String , java . lang . String > > anyObject ( ) ) ) . andReturn ( inputStream ) ; java . io . InputStream inputStreamActive = org . apache . commons . io . IOUtils . toInputStream ( "{\"clusterInfo\":<sp>{\"haState\":<sp>\"ACTIVE\"}}" ) ; expect ( urlStreamProvider . readFrom ( eq ( ( ( org . apache . ambari . view . utils . ambari . ServicesTest . HTTP_RM_URL2 ) + ( org . apache . ambari . view . utils . ambari . ServicesTest . RM_INFO_API_ENDPOINT ) ) ) , eq ( "GET" ) , anyString ( ) , org . easymock . EasyMock . < java . util . Map < java . lang . String , java . lang . String > > anyObject ( ) ) ) . andReturn ( inputStreamActive ) ; replayAll ( ) ; org . apache . ambari . view . utils . ambari . Services services = new org . apache . ambari . view . utils . ambari . Services ( ambariApi , viewContext ) ; "<AssertPlaceHolder>" ; verify ( urlStreamProvider ) ; } getRMUrl ( ) { return ambariApi . getServices ( ) . getRMUrl ( ) ; }
org . junit . Assert . assertEquals ( org . apache . ambari . view . utils . ambari . ServicesTest . HTTP_RM_URL2 , services . getRMUrl ( ) )
testWriteListOfDerivedTypes ( ) { org . apache . cxf . jaxrs . provider . json . JSONProvider < org . apache . cxf . jaxrs . provider . json . JSONProviderTest . Books2 > p = new org . apache . cxf . jaxrs . provider . json . JSONProvider ( ) ; java . util . Map < java . lang . String , java . lang . String > namespaceMap = new java . util . HashMap ( ) ; namespaceMap . put ( "http://www.w3.org/2001/XMLSchema-instance" , "xsins" ) ; p . setNamespaceMap ( namespaceMap ) ; org . apache . cxf . jaxrs . provider . json . JSONProviderTest . Books2 books2 = new org . apache . cxf . jaxrs . provider . json . JSONProviderTest . Books2 ( ) ; books2 . setBooks ( java . util . Collections . singletonList ( new org . apache . cxf . jaxrs . resources . SuperBook ( "CXF<sp>Rocks" , 123L , 124L ) ) ) ; java . io . ByteArrayOutputStream os = new java . io . ByteArrayOutputStream ( ) ; p . writeTo ( books2 , org . apache . cxf . jaxrs . provider . json . JSONProviderTest . Books2 . class , org . apache . cxf . jaxrs . provider . json . JSONProviderTest . Books2 . class , org . apache . cxf . jaxrs . provider . json . JSONProviderTest . Books2 . class . getAnnotations ( ) , MediaType . APPLICATION_JSON_TYPE , new org . apache . cxf . jaxrs . impl . MetadataMap < java . lang . String , java . lang . Object > ( ) , os ) ; java . lang . String s = os . toString ( ) ; java . lang . String data = "{\"books2\":{\"books\":{\"@xsins.type\":\"superBook\",\"id\":123," + "\"name\":\"CXF<sp>Rocks\",\"state\":\"\",\"superId\":124}}}" ; "<AssertPlaceHolder>" ; } toString ( ) { return value ; }
org . junit . Assert . assertEquals ( data , s )
setServiceDiscoveryFactory ( ) { io . katharsis . core . internal . boot . KatharsisBoot boot = new io . katharsis . core . internal . boot . KatharsisBoot ( ) ; boot . setServiceDiscoveryFactory ( serviceDiscoveryFactory ) ; boot . setDefaultServiceUrlProvider ( org . mockito . Mockito . mock ( io . katharsis . resource . registry . ServiceUrlProvider . class ) ) ; boot . boot ( ) ; org . mockito . Mockito . verify ( serviceDiscoveryFactory , org . mockito . Mockito . times ( 1 ) ) . getInstance ( ) ; "<AssertPlaceHolder>" ; } getServiceDiscovery ( ) { return moduleRegistry . getServiceDiscovery ( ) ; }
org . junit . Assert . assertNotNull ( boot . getServiceDiscovery ( ) )
testGetDayDemoFieldEncodingMap ( ) { java . util . Map < java . lang . String , java . util . Map < java . lang . String , java . lang . Object > > fieldEncodings = org . numenta . nupic . examples . napi . hotgym . NetworkDemoHarness . getDayDemoFieldEncodingMap ( ) ; "<AssertPlaceHolder>" ; } getDayDemoFieldEncodingMap ( ) { java . util . Map < java . lang . String , java . util . Map < java . lang . String , java . lang . Object > > fieldEncodings = org . numenta . nupic . examples . napi . hotgym . NetworkDemoHarness . setupMap ( null , 8 , 3 , 0.0 , 8.0 , 0 , 1 , Boolean . TRUE , null , Boolean . TRUE , "dayOfWeek" , "number" , "ScalarEncoder" ) ; return fieldEncodings ; }
org . junit . Assert . assertEquals ( 1 , fieldEncodings . size ( ) )
testSerialization ( ) { org . jfree . chart . needle . WindNeedle n1 = new org . jfree . chart . needle . WindNeedle ( ) ; org . jfree . chart . needle . WindNeedle n2 = ( ( org . jfree . chart . needle . WindNeedle ) ( org . jfree . chart . TestUtilities . serialised ( n1 ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; mdz . hc . ProcessValue other = ( ( mdz . hc . ProcessValue ) ( obj ) ) ; if ( ( state ) != ( other . state ) ) return false ; if ( ( timestamp ) == null ) { if ( ( other . timestamp ) != null ) return false ; } else if ( ! ( timestamp . equals ( other . timestamp ) ) ) return false ; if ( ( value ) == null ) { if ( ( other . value ) != null ) return false ; } else if ( ! ( value . equals ( other . value ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( n1 . equals ( n2 ) )
test2 ( ) { cc . redberry . rings . IntegersZp64 domain = new cc . redberry . rings . IntegersZp64 ( 43313 ) ; java . lang . String [ ] vars = new java . lang . String [ ] { "a" , "b" } ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] factors = new cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] { cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "36045*b^2+23621*a*b+21517*a^2" , domain , vars ) , cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "12894*b^3+22166*a+31033*a*b^2+25906*a^2*b^3" , domain , vars ) , cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "2387*b+11677*a+14775*a^2+25925*a^2*b" , domain , vars ) , cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "1+17708*a*b^2+7251*a*b^5+12898*a^2*b^2+12277*a^3*b^4+23269*a^5*b" , domain , vars ) , cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "27799+34918*a+25070*a^2+2145*a^2*b" , domain , vars ) } ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 base = cc . redberry . rings . poly . multivar . HenselLiftingTest . multiply ( factors ) ; assert cc . redberry . rings . poly . multivar . MultivariateGCD . PolynomialGCD ( factors ) . isConstant ( ) ; cc . redberry . rings . poly . multivar . HenselLifting . lEvaluation evaluation = new cc . redberry . rings . poly . multivar . HenselLifting . lEvaluation ( base . nVariables , new long [ ] { 1146 } , domain , base . ordering ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] uFactors = evaluation . evaluateFrom ( factors , 1 ) ; System . out . println ( cc . redberry . rings . poly . multivar . HenselLiftingTest . allCoprime ( uFactors ) ) ; System . out . println ( java . util . stream . IntStream . range ( 0 , uFactors . length ) . allMatch ( ( i ) -> ( factors [ i ] . degree ( 0 ) ) == ( uFactors [ i ] . degree ( 0 ) ) ) ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] factorsLC = java . util . Arrays . stream ( factors ) . map ( ( f ) -> f . lc ( 0 ) ) . toArray ( cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] :: new ) ; cc . redberry . rings . poly . multivar . HenselLifting . multivariateLift0 ( base , uFactors , factorsLC , evaluation , base . degrees ( ) ) ; "<AssertPlaceHolder>" ; } multiply ( Poly extends cc . redberry . rings . poly . multivar . AMultivariatePolynomial ) { factory . assertSameCoefficientRingWith ( oth ) ; if ( isTrivial ( ) ) return cc . redberry . rings . poly . multivar . Ideal . create ( cc . redberry . rings . poly . multivar . Collections . singletonList ( oth ) , ordering ) ; if ( oth . isZero ( ) ) return cc . redberry . rings . poly . multivar . Ideal . trivial ( oth , ordering ) ; if ( ( oth . isOne ( ) ) || ( this . isEmpty ( ) ) ) return this ; return new cc . redberry . rings . poly . multivar . Ideal ( canonicalize ( groebnerBasis . stream ( ) . map ( ( p ) -> p . clone ( ) . multiply ( oth ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ) ; }
org . junit . Assert . assertEquals ( base , cc . redberry . rings . poly . multivar . HenselLiftingTest . multiply ( uFactors ) )
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . change . tracking . model . CTEntry . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "ctEntryId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "ctEntryId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testCastToString ( ) { java . lang . String result = testDialect . getSqlFrom ( new org . alfasoftware . morf . sql . element . Cast ( new org . alfasoftware . morf . sql . element . FieldReference ( "value" ) , org . alfasoftware . morf . metadata . DataType . STRING , 10 ) ) ; "<AssertPlaceHolder>" ; } expectedStringCast ( ) { return "CAST(value<sp>AS<sp>VARCHAR(10))" ; }
org . junit . Assert . assertEquals ( expectedStringCast ( ) , result )
testFindByNodeId ( ) { org . opennms . netmgt . model . OnmsNode onmsNode = new org . opennms . netmgt . model . OnmsNode ( m_locationDao . getDefaultLocation ( ) , "myNode" ) ; m_nodeDao . save ( onmsNode ) ; org . opennms . netmgt . model . OnmsAssetRecord assetRecord = onmsNode . getAssetRecord ( ) ; assetRecord . setAssetNumber ( "imported-id:<sp>7" ) ; m_assetRecordDao . update ( assetRecord ) ; m_assetRecordDao . flush ( ) ; org . opennms . netmgt . model . OnmsAssetRecord a = m_assetRecordDao . findByNodeId ( onmsNode . getId ( ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ! ( obj instanceof org . opennms . netmgt . provision . persist . requisition . RequisitionCategory ) ) return false ; final org . opennms . netmgt . provision . persist . requisition . RequisitionCategory other = ( ( org . opennms . netmgt . provision . persist . requisition . RequisitionCategory ) ( obj ) ) ; if ( ( m_name ) == null ) { if ( ( other . m_name ) != null ) return false ; } else if ( ! ( m_name . equals ( other . m_name ) ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( a . equals ( assetRecord ) )
testInitDynAnyFromAny ( ) { java . lang . String msg ; org . jacorb . test . StructType type ; org . omg . CORBA . Any any = null ; org . omg . CORBA . TypeCode tc = null ; org . omg . DynamicAny . DynStruct dynAny = null ; org . omg . DynamicAny . DynStruct dynAny2 = null ; tc = org . jacorb . test . StructTypeHelper . type ( ) ; dynAny = createDynAnyFromTypeCode ( tc ) ; type = new org . jacorb . test . StructType ( 1 , "Hello" ) ; any = orb . create_any ( ) ; org . jacorb . test . StructTypeHelper . insert ( any , type ) ; dynAny2 = createDynAnyFromAny ( any ) ; msg = "Failed<sp>to<sp>initialize<sp>a<sp>DynAny<sp>object<sp>from<sp>an<sp>Any<sp>object<sp>" ; msg += "using<sp>the<sp>DynAny::from_any<sp>operation" ; try { dynAny . from_any ( any ) ; } catch ( java . lang . Throwable ex ) { org . junit . Assert . fail ( ( ( msg + ":<sp>" ) + ex ) ) ; } "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) )
testAssertion ( ) { org . semanticweb . owlapi . util . OWLClassExpressionCollector testsubject = new org . semanticweb . owlapi . util . OWLClassExpressionCollector ( ) ; java . util . Collection < org . semanticweb . owlapi . model . OWLClassExpression > components = object . accept ( testsubject ) ; java . util . Set < java . lang . String > strings = asUnorderedSet ( components . stream ( ) . map ( Object :: toString ) ) ; "<AssertPlaceHolder>" ; } stream ( ) { return java . util . stream . Stream . of ( org . semanticweb . owlapi . vocab . SKOSVocabulary . values ( ) ) ; }
org . junit . Assert . assertEquals ( expected , strings )
testLayoutCacheIsSerializable ( ) { tree . setHeaderVisible ( true ) ; new org . eclipse . swt . widgets . TreeColumn ( tree , org . eclipse . swt . SWT . NONE ) ; int headerHeight = tree . getHeaderHeight ( ) ; org . eclipse . swt . widgets . Tree deserializedTree = serializeAndDeserialize ( tree ) ; "<AssertPlaceHolder>" ; } getHeaderHeight ( ) { checkWidget ( ) ; if ( ! ( layoutCache . hasHeaderHeight ( ) ) ) { layoutCache . headerHeight = computeHeaderHeight ( ) ; } return layoutCache . headerHeight ; }
org . junit . Assert . assertEquals ( headerHeight , deserializedTree . getHeaderHeight ( ) )
testCoreQueryWithXMLParametersReference ( ) { org . nuxeo . ecm . platform . contentview . jsf . ContentView contentView = service . getContentView ( "CURRENT_DOCUMENT_CHILDREN_REF" ) ; "<AssertPlaceHolder>" ; java . lang . String parentIdParam = session . getRootDocument ( ) . getId ( ) ; org . nuxeo . ecm . platform . query . api . PageProvider < org . nuxeo . ecm . core . api . DocumentModel > pp = ( ( org . nuxeo . ecm . platform . query . api . PageProvider < org . nuxeo . ecm . core . api . DocumentModel > ) ( contentView . getPageProvider ( ) ) ) ; checkCoreQuery ( parentIdParam , pp ) ; } getContentView ( java . lang . String ) { return contentViews . get ( id ) ; }
org . junit . Assert . assertNotNull ( contentView )
testCtor_NullPayload ( ) { byte [ ] payload = null ; message = new net . xenqtt . client . PublishMessage ( "grand/foo/bar" , net . xenqtt . message . QoS . AT_MOST_ONCE , payload , true ) ; "<AssertPlaceHolder>" ; } getPayload ( ) { return getBytes ( getPayloadIndex ( ) ) ; }
org . junit . Assert . assertArrayEquals ( new byte [ ] { } , message . getPayload ( ) )
getProbeNullTest ( ) { probeConfig = new io . fabric8 . maven . core . config . ProbeConfig . Builder ( ) . build ( ) ; probe = probeHandler . getProbe ( probeConfig ) ; "<AssertPlaceHolder>" ; } getProbe ( io . fabric8 . maven . core . config . ProbeConfig ) { if ( probeConfig == null ) { return null ; } io . fabric8 . kubernetes . api . model . Probe probe = new io . fabric8 . kubernetes . api . model . Probe ( ) ; java . lang . Integer initialDelaySeconds = probeConfig . getInitialDelaySeconds ( ) ; if ( initialDelaySeconds != null ) { probe . setInitialDelaySeconds ( initialDelaySeconds ) ; } java . lang . Integer timeoutSeconds = probeConfig . getTimeoutSeconds ( ) ; if ( timeoutSeconds != null ) { probe . setTimeoutSeconds ( timeoutSeconds ) ; } java . lang . Integer failureThreshold = probeConfig . getFailureThreshold ( ) ; if ( failureThreshold != null ) { probe . setFailureThreshold ( failureThreshold ) ; } java . lang . Integer successThreshold = probeConfig . getSuccessThreshold ( ) ; if ( successThreshold != null ) { probe . setSuccessThreshold ( successThreshold ) ; } io . fabric8 . kubernetes . api . model . HTTPGetAction getAction = getHTTPGetAction ( probeConfig . getGetUrl ( ) ) ; if ( getAction != null ) { probe . setHttpGet ( getAction ) ; return probe ; } io . fabric8 . kubernetes . api . model . ExecAction execAction = getExecAction ( probeConfig . getExec ( ) ) ; if ( execAction != null ) { probe . setExec ( execAction ) ; return probe ; } io . fabric8 . kubernetes . api . model . TCPSocketAction tcpSocketAction = getTCPSocketAction ( probeConfig . getGetUrl ( ) , probeConfig . getTcpPort ( ) ) ; if ( tcpSocketAction != null ) { probe . setTcpSocket ( tcpSocketAction ) ; return probe ; } return null ; }
org . junit . Assert . assertNull ( probe )
testPutKeyValue ( ) { com . liferay . portal . kernel . json . JSONObject jsonObject1 = _createJSONObject ( ) ; jsonObject1 . put ( "alpha" , "beta" ) ; com . liferay . portal . kernel . json . JSONObject jsonObject2 = com . liferay . portal . kernel . json . JSONUtil . put ( "alpha" , "beta" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return com . liferay . journal . content . search . web . configuration . JournalContentSearchWebConfigurationUtil . _configuration . get ( key ) ; }
org . junit . Assert . assertEquals ( jsonObject1 . get ( "alpha" ) , jsonObject2 . get ( "alpha" ) )
testExportReportWithNullReport ( ) { masterReport = null ; when ( swingGuiContext . getLocale ( ) ) . thenReturn ( Locale . US ) ; when ( swingGuiContext . getStatusListener ( ) ) . thenReturn ( mock ( org . pentaho . reporting . engine . classic . core . modules . gui . common . StatusListener . class ) ) ; java . lang . Runnable exportTask = new org . pentaho . di . trans . steps . pentahoreporting . ReportExportTask ( masterReport , swingGuiContext , targetPath , createParentFolder ) { protected org . pentaho . reporting . engine . classic . core . layout . output . ReportProcessor createReportProcessor ( java . io . OutputStream fout ) throws org . pentaho . di . trans . steps . pentahoreporting . Exception { return null ; } } ; "<AssertPlaceHolder>" ; } getStatusListener ( ) { return this ; }
org . junit . Assert . assertNull ( exportTask )
testNcPropertiesNotNullOrEmpty_AllEmpty ( ) { when ( config . getNamedCluster ( ) . getHdfsHost ( ) ) . thenReturn ( org . pentaho . big . data . kettle . plugins . sqoop . SqoopConfigTest . EMPTY ) ; when ( config . getNamedCluster ( ) . getHdfsPort ( ) ) . thenReturn ( org . pentaho . big . data . kettle . plugins . sqoop . SqoopConfigTest . EMPTY ) ; when ( config . getNamedCluster ( ) . getJobTrackerHost ( ) ) . thenReturn ( org . pentaho . big . data . kettle . plugins . sqoop . SqoopConfigTest . EMPTY ) ; when ( config . getNamedCluster ( ) . getJobTrackerPort ( ) ) . thenReturn ( org . pentaho . big . data . kettle . plugins . sqoop . SqoopConfigTest . EMPTY ) ; boolean ncPropertiesNotNullOrEmpty = config . ncPropertiesNotNullOrEmpty ( config . getNamedCluster ( ) ) ; "<AssertPlaceHolder>" ; } getNamedCluster ( ) { org . pentaho . metastore . api . IMetaStore metaStore = metastoreLocator . getMetastore ( ) ; if ( metaStore == null ) { return null ; } java . lang . String queryParam = getQueryParam ( org . pentaho . big . data . api . jdbc . impl . JdbcUrlImpl . PENTAHO_NAMED_CLUSTER ) ; if ( queryParam == null ) { return null ; } return namedClusterService . read ( queryParam , metaStore ) ; }
org . junit . Assert . assertFalse ( ncPropertiesNotNullOrEmpty )
bulkOperationRequestSucceed ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . IndividualEnrollment , tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . BulkEnrollmentOperation , tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . BulkEnrollmentOperationResult ) { final java . lang . String bulkEnrollmentPath = "enrollments" ; final java . lang . String bulkEnrollmentPayload = "validJson" ; final java . lang . String resultPayload = "validJson" ; final java . util . Collection < tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . IndividualEnrollment > individualEnrollments = new java . util . LinkedList ( ) ; individualEnrollments . add ( mockedIndividualEnrollment ) ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . IndividualEnrollmentManager individualEnrollmentManager = createIndividualEnrollmentManager ( ) ; new tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . StrictExpectations ( ) { { mockedBulkOperation . toJson ( BulkOperationMode . CREATE , individualEnrollments ) ; result = bulkEnrollmentPayload ; times = 1 ; mockedContractApiHttp . request ( HttpMethod . POST , bulkEnrollmentPath , null , bulkEnrollmentPayload ) ; result = mockedHttpResponse ; times = 1 ; mockedHttpResponse . getBody ( ) ; result = resultPayload . getBytes ( ) ; times = 1 ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . Deencapsulation . newInstance ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . BulkEnrollmentOperationResult . class , resultPayload ) ; result = mockedBulkEnrollmentOperationResult ; times = 1 ; } } ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . BulkEnrollmentOperationResult bulkEnrollmentOperationResult = tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . Deencapsulation . invoke ( individualEnrollmentManager , "bulkOperation" , new java . lang . Class [ ] { tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . BulkOperationMode . class , java . util . Collection . class } , BulkOperationMode . CREATE , individualEnrollments ) ; "<AssertPlaceHolder>" ; } invoke ( java . lang . String , java . lang . String , java . lang . String , java . lang . Long , java . lang . Long , java . lang . Object ) { java . net . URL url = this . iotHubConnectionString . getUrlModuleMethod ( deviceId , moduleId ) ; return invokeMethod ( url , methodName , responseTimeoutInSeconds , connectTimeoutInSeconds , payload ) ; }
org . junit . Assert . assertNotNull ( bulkEnrollmentOperationResult )
testLegacyPortletWithControlPanelEntry ( ) { int initialServiceRegistrationsSize = _hotDeployListener . getServiceRegistrationsSize ( ) ; com . liferay . portal . kernel . deploy . hot . HotDeployEvent hotDeployEvent = getHotDeployEvent ( ( "classpath:/com/liferay/application/list/deploy/hot/test" + "/dependencies/control-panel-entry-liferay-portlet.xml" ) ) ; _hotDeployListener . invokeDeploy ( hotDeployEvent ) ; "<AssertPlaceHolder>" ; } getServiceRegistrationsSize ( ) { return _serviceRegistrations . size ( ) ; }
org . junit . Assert . assertEquals ( ( initialServiceRegistrationsSize + 1 ) , _hotDeployListener . getServiceRegistrationsSize ( ) )
testConfigurePortForwardingRulesOnLogicalRouterRollback ( ) { resource . configure ( "NiciraNvpResource" , parameters ) ; final com . cloud . legacymodel . communication . command . ConfigurePortForwardingRulesOnLogicalRouterCommand cmd = mock ( com . cloud . legacymodel . communication . command . ConfigurePortForwardingRulesOnLogicalRouterCommand . class ) ; final com . cloud . legacymodel . to . PortForwardingRuleTO rule = new com . cloud . legacymodel . to . PortForwardingRuleTO ( 1 , "11.11.11.11" , 80 , 80 , "10.10.10.10" , 8080 , 8080 , "tcp" , false , false ) ; final java . util . List < com . cloud . legacymodel . to . PortForwardingRuleTO > rules = new java . util . ArrayList ( ) ; rules . add ( rule ) ; when ( cmd . getRules ( ) ) . thenReturn ( rules ) ; when ( cmd . getLogicalRouterUuid ( ) ) . thenReturn ( "aaaaa" ) ; final com . cloud . network . nicira . NatRule [ ] rulepair = resource . generatePortForwardingRulePair ( "10.10.10.10" , new int [ ] { 8080 , 8080 } , "11.11.11.11" , new int [ ] { 80 , 80 } , "tcp" ) ; rulepair [ 0 ] . setUuid ( java . util . UUID . randomUUID ( ) ) ; rulepair [ 1 ] . setUuid ( java . util . UUID . randomUUID ( ) ) ; when ( nvpApi . createLogicalRouterNatRule ( eq ( "aaaaa" ) , ( ( com . cloud . network . nicira . NatRule ) ( any ( ) ) ) ) ) . thenReturn ( rulepair [ 0 ] ) . thenThrow ( new com . cloud . network . nicira . NiciraNvpApiException ( ) ) ; final java . util . List < com . cloud . network . nicira . NatRule > storedRules = java . util . Collections . EMPTY_LIST ; when ( nvpApi . findNatRulesByLogicalRouterUuid ( "aaaaa" ) ) . thenReturn ( storedRules ) ; final com . cloud . legacymodel . communication . answer . ConfigurePortForwardingRulesOnLogicalRouterAnswer a = ( ( com . cloud . legacymodel . communication . answer . ConfigurePortForwardingRulesOnLogicalRouterAnswer ) ( resource . executeRequest ( cmd ) ) ) ; "<AssertPlaceHolder>" ; verify ( nvpApi , atLeastOnce ( ) ) . deleteLogicalRouterNatRule ( eq ( "aaaaa" ) , eq ( rulepair [ 0 ] . getUuid ( ) ) ) ; } getResult ( ) { return result ; }
org . junit . Assert . assertFalse ( a . getResult ( ) )
createKeystoreProvider ( ) { java . io . File targetDir = new java . io . File ( ( ( java . lang . System . getProperty ( "user.dir" ) ) + "/target" ) ) ; java . io . File keystoreFile = new java . io . File ( targetDir , "create.jks" ) ; if ( keystoreFile . exists ( ) ) { if ( ! ( keystoreFile . delete ( ) ) ) { org . apache . accumulo . core . conf . CredentialProviderFactoryShimTest . log . error ( "Unable<sp>to<sp>delete<sp>{}" , keystoreFile ) ; } } java . lang . String providerUrl = "jceks://file" + ( keystoreFile . getAbsolutePath ( ) ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( CredentialProviderFactoryShim . CREDENTIAL_PROVIDER_PATH , providerUrl ) ; java . lang . String alias = "foo" ; char [ ] credential = "bar" . toCharArray ( ) ; org . apache . accumulo . core . conf . CredentialProviderFactoryShim . createEntry ( conf , alias , credential ) ; "<AssertPlaceHolder>" ; } getValueFromCredentialProvider ( org . apache . hadoop . conf . Configuration , java . lang . String ) { requireNonNull ( conf ) ; requireNonNull ( alias ) ; if ( org . apache . accumulo . core . conf . CredentialProviderFactoryShim . isHadoopCredentialProviderAvailable ( ) ) { org . apache . accumulo . core . conf . CredentialProviderFactoryShim . log . trace ( "Hadoop<sp>CredentialProvider<sp>is<sp>available,<sp>attempting<sp>to<sp>extract<sp>value<sp>for<sp>{}" , alias ) ; return org . apache . accumulo . core . conf . CredentialProviderFactoryShim . getFromHadoopCredentialProvider ( conf , alias ) ; } return null ; }
org . junit . Assert . assertArrayEquals ( credential , org . apache . accumulo . core . conf . CredentialProviderFactoryShim . getValueFromCredentialProvider ( conf , alias ) )
testReconstructQueue2 ( ) { int [ ] [ ] people = new int [ ] [ ] { new int [ ] { 8 , 2 } , new int [ ] { 4 , 2 } , new int [ ] { 4 , 5 } , new int [ ] { 2 , 0 } , new int [ ] { 7 , 2 } , new int [ ] { 1 , 4 } , new int [ ] { 9 , 1 } , new int [ ] { 3 , 1 } , new int [ ] { 9 , 0 } , new int [ ] { 1 , 0 } } ; people = t . reconstructQueue ( people ) ; "<AssertPlaceHolder>" ; } reconstructQueue ( int [ ] [ ] ) { if ( ( people == null ) || ( ( people . length ) == 0 ) ) { return people ; } java . util . List < com . pengyifan . leetcode . QueueReconstructionByHeight . Person > list = new java . util . ArrayList ( ) ; for ( int [ ] person : people ) { list . add ( new com . pengyifan . leetcode . QueueReconstructionByHeight . Person ( person [ 0 ] , person [ 1 ] ) ) ; } list . sort ( ( p1 , p2 ) -> { int c = - ( java . lang . Integer . compare ( p1 . height , p2 . height ) ) ; if ( c == 0 ) { c = java . lang . Integer . compare ( p1 . number , p2 . number ) ; } return c ; } ) ; java . util . List < com . pengyifan . leetcode . QueueReconstructionByHeight . Person > queue = new java . util . ArrayList ( ) ; for ( com . pengyifan . leetcode . QueueReconstructionByHeight . Person p : list ) { queue . add ( p . number , p ) ; } people = new int [ people . length ] [ 2 ] ; for ( int i = 0 ; i < ( people . length ) ; i ++ ) { people [ i ] = new int [ 2 ] ; people [ i ] [ 0 ] = queue . get ( i ) . height ; people [ i ] [ 1 ] = queue . get ( i ) . number ; } return people ; }
org . junit . Assert . assertEquals ( 1 , people [ 0 ] [ 0 ] )
testExportImportWithEmptyDocumentLibraryField ( ) { java . lang . String documentLibraryFieldName = "Attachment" ; com . liferay . dynamic . data . lists . model . DDLRecordSet recordSet = addRecordSetWithDocumentLibraryField ( documentLibraryFieldName ) ; com . liferay . dynamic . data . lists . helper . DDLRecordTestHelper recordTestHelper = new com . liferay . dynamic . data . lists . helper . DDLRecordTestHelper ( stagingGroup , recordSet ) ; com . liferay . dynamic . data . mapping . storage . DDMFormValues ddmFormValues = recordTestHelper . createEmptyDDMFormValues ( ) ; com . liferay . dynamic . data . mapping . storage . DDMFormFieldValue ddmFormFieldValue = createEmptyDocumentLibraryDDMFormFieldValue ( ddmFormValues . getDefaultLocale ( ) , documentLibraryFieldName ) ; ddmFormValues . addDDMFormFieldValue ( ddmFormFieldValue ) ; com . liferay . dynamic . data . lists . model . DDLRecord ddlRecord = recordTestHelper . addRecord ( ddmFormValues , WorkflowConstants . ACTION_PUBLISH ) ; exportImportStagedModel ( ddlRecord ) ; com . liferay . dynamic . data . lists . model . DDLRecord importedDDLRecord = com . liferay . dynamic . data . lists . service . DDLRecordLocalServiceUtil . getDDLRecordByUuidAndGroupId ( ddlRecord . getUuid ( ) , liveGroup . getGroupId ( ) ) ; "<AssertPlaceHolder>" ; } getGroupId ( ) { return _groupId ; }
org . junit . Assert . assertNotNull ( importedDDLRecord )
toVOServiceOperationParameter_Null ( ) { org . oscm . internal . vo . VOServiceOperationParameter result = org . oscm . serviceprovisioningservice . assembler . TechServiceOperationParameterAssembler . toVOServiceOperationParameter ( null , facade ) ; "<AssertPlaceHolder>" ; } toVOServiceOperationParameter ( org . oscm . domobjects . OperationParameter , org . oscm . i18nservice . bean . LocalizerFacade ) { if ( parameter == null ) { return null ; } org . oscm . internal . vo . VOServiceOperationParameter voParameter = new org . oscm . internal . vo . VOServiceOperationParameter ( ) ; org . oscm . serviceprovisioningservice . assembler . TechServiceOperationParameterAssembler . updateParameter ( parameter , localizerFacade , voParameter ) ; return voParameter ; }
org . junit . Assert . assertNull ( result )
testSubtract02 ( ) { javax . el . ELProcessor processor = new javax . el . ELProcessor ( ) ; java . lang . Object result = processor . eval ( "null<sp>-<sp>null" ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { return org . apache . tomcat . util . net . jsse . openssl . Cipher . idMap . get ( java . lang . Integer . valueOf ( cipherId ) ) ; }
org . junit . Assert . assertEquals ( java . lang . Long . valueOf ( 0 ) , result )
testGetElement ( ) { final elemental2 . dom . HTMLElement expected = mock ( elemental2 . dom . HTMLElement . class ) ; when ( view . getElement ( ) ) . thenReturn ( expected ) ; final elemental2 . dom . Element actual = dateSelector . getElement ( ) ; "<AssertPlaceHolder>" ; } getElement ( ) { return view . getElement ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testRemoveTopLevelDataTypesWhenItemDataTypeIsAReferenceToDestroyedDataType ( ) { final java . lang . String uuid = "uuid" ; final org . kie . workbench . common . dmn . client . editors . types . common . DataType dataType = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final org . kie . workbench . common . dmn . client . editors . types . common . DataType dataType0 = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final org . kie . workbench . common . dmn . client . editors . types . common . DataType dataType1 = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; doReturn ( dataType ) . when ( listItem ) . getDataType ( ) ; when ( listItem . getDataType ( ) ) . thenReturn ( dataType ) ; when ( dataType . getUUID ( ) ) . thenReturn ( uuid ) ; when ( dataType . getUUID ( ) ) . thenReturn ( "012" ) ; when ( dataType . getName ( ) ) . thenReturn ( "tCity" ) ; when ( dataType . getType ( ) ) . thenReturn ( "Structure" ) ; when ( dataType . isTopLevel ( ) ) . thenReturn ( true ) ; when ( dataType0 . getUUID ( ) ) . thenReturn ( "012" ) ; when ( dataType0 . getName ( ) ) . thenReturn ( "tCity" ) ; when ( dataType0 . getType ( ) ) . thenReturn ( "Structure" ) ; when ( dataType0 . isTopLevel ( ) ) . thenReturn ( true ) ; when ( dataType1 . getUUID ( ) ) . thenReturn ( "678" ) ; when ( dataType1 . getName ( ) ) . thenReturn ( "tCompany" ) ; when ( dataType1 . getType ( ) ) . thenReturn ( "Structure" ) ; when ( dataType1 . isTopLevel ( ) ) . thenReturn ( true ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > actualDataTypes = listItem . removeTopLevelDataTypes ( asList ( dataType0 , dataType1 ) ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > expectedDataTypes = singletonList ( dataType0 ) ; verify ( dataTypeList ) . removeItem ( dataType0 ) ; "<AssertPlaceHolder>" ; } removeItem ( org . kie . workbench . common . screens . datamodeller . client . widgets . advanceddomain . annotationlisteditor . item . AnnotationListItem ) { accordionsContainer . remove ( listItem ) ; }
org . junit . Assert . assertEquals ( expectedDataTypes , actualDataTypes )
testCompare ( ) { java . util . List < org . eclipse . tycho . core . ee . StandardExecutionEnvironment > expectedList = new java . util . ArrayList ( java . util . Arrays . asList ( osgiMin10Environment , osgiMin11Environment , osgiMin12Environment , cdc10Environment , cdc11Environment , jre11Environment , j2SE12Environment , j2SE13Environment , j2SE14Environment , j2SE5Enviroment , javaSE6Enviroment , javaSE7Enviroment , javaSECompact1Enviroment , javaSECompact2Enviroment , javaSECompact3Enviroment , javaSE8Environment , javaSE9Environment , javaSE10Environment , javaSE11Environment ) ) ; java . util . List < org . eclipse . tycho . core . ee . StandardExecutionEnvironment > actualList = new java . util . ArrayList ( expectedList ) ; java . util . Collections . shuffle ( actualList ) ; java . util . Collections . sort ( actualList ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expectedList , actualList )
updateNamespaceIamRoleAuthorizationAssertCallsService ( ) { java . lang . String expectedNamespace = "namespace" ; org . finra . herd . model . api . xml . NamespaceIamRoleAuthorizationUpdateRequest expectedRequest = new org . finra . herd . model . api . xml . NamespaceIamRoleAuthorizationUpdateRequest ( ) ; org . finra . herd . model . api . xml . NamespaceIamRoleAuthorization expectedResult = new org . finra . herd . model . api . xml . NamespaceIamRoleAuthorization ( ) ; when ( namespaceIamRoleAuthorizationService . updateNamespaceIamRoleAuthorization ( any ( ) , any ( ) ) ) . thenReturn ( expectedResult ) ; org . finra . herd . model . api . xml . NamespaceIamRoleAuthorization actualResult = namespaceIamRoleAuthorizationRestController . updateNamespaceIamRoleAuthorization ( expectedNamespace , expectedRequest ) ; verify ( namespaceIamRoleAuthorizationService ) . updateNamespaceIamRoleAuthorization ( expectedNamespace , expectedRequest ) ; verifyNoMoreInteractions ( namespaceIamRoleAuthorizationService ) ; "<AssertPlaceHolder>" ; } updateNamespaceIamRoleAuthorization ( java . lang . String , org . finra . herd . model . api . xml . NamespaceIamRoleAuthorizationUpdateRequest ) { org . springframework . util . Assert . hasText ( namespace , "Namespace<sp>must<sp>be<sp>specified" ) ; org . springframework . util . Assert . notNull ( request , "NamespaceIamRoleAuthorizationCreateRequest<sp>must<sp>be<sp>specified" ) ; validateIamRoles ( request . getIamRoles ( ) ) ; org . finra . herd . model . jpa . NamespaceEntity namespaceEntity = namespaceDaoHelper . getNamespaceEntity ( namespace . trim ( ) ) ; java . util . List < org . finra . herd . model . jpa . NamespaceIamRoleAuthorizationEntity > namespaceIamRoleAuthorizationEntities = getNamespaeIamRoleAuthorizationEntities ( namespaceEntity ) ; for ( org . finra . herd . model . jpa . NamespaceIamRoleAuthorizationEntity namespaceIamRoleAuthorizationEntity : namespaceIamRoleAuthorizationEntities ) { namespaceIamRoleAuthorizationDao . delete ( namespaceIamRoleAuthorizationEntity ) ; } org . finra . herd . model . api . xml . NamespaceIamRoleAuthorization result = new org . finra . herd . model . api . xml . NamespaceIamRoleAuthorization ( namespaceEntity . getCode ( ) , new java . util . ArrayList ( ) ) ; for ( org . finra . herd . model . api . xml . IamRole iamRole : request . getIamRoles ( ) ) { org . finra . herd . model . jpa . NamespaceIamRoleAuthorizationEntity namespaceIamRoleAuthorizationEntity = createNamespaceIamRoleAuthorizationEntity ( namespaceEntity , iamRole ) ; namespaceIamRoleAuthorizationDao . saveAndRefresh ( namespaceIamRoleAuthorizationEntity ) ; result . getIamRoles ( ) . add ( new org . finra . herd . model . api . xml . IamRole ( namespaceIamRoleAuthorizationEntity . getIamRoleName ( ) , namespaceIamRoleAuthorizationEntity . getDescription ( ) ) ) ; } return result ; }
org . junit . Assert . assertEquals ( expectedResult , actualResult )
shouldReturnTrueIfNewFPMethodOfTheECIsDMPAInjectable ( ) { boolean didRuleSucceed = rule . apply ( new org . ei . drishti . util . SafeMap ( mapOf ( "currentMethod" , "dmpa_injectable" ) ) ) ; "<AssertPlaceHolder>" ; } mapOf ( Key , Value ) { java . util . HashMap < Key , Value > normalMap = new java . util . HashMap ( ) ; normalMap . put ( key , value ) ; return normalMap ; }
org . junit . Assert . assertTrue ( didRuleSucceed )
test ( ) { refs = new org . multiverse . stms . gamma . transactionalobjects . GammaTxnLong [ refCount ] ; for ( int k = 0 ; k < ( refCount ) ; k ++ ) { refs [ k ] = new org . multiverse . stms . gamma . transactionalobjects . GammaTxnLong ( stm ) ; } org . multiverse . stms . gamma . integration . commute . Commute_AbstractTest . WorkerThread [ ] workers = new org . multiverse . stms . gamma . integration . commute . Commute_AbstractTest . WorkerThread [ workerCount ] ; for ( int k = 0 ; k < ( workers . length ) ; k ++ ) { workers [ k ] = new org . multiverse . stms . gamma . integration . commute . Commute_AbstractTest . WorkerThread ( k ) ; } startAll ( workers ) ; sleepMs ( getStressTestDurationMs ( ( 30 * 1000 ) ) ) ; stop = true ; joinAll ( workers ) ; "<AssertPlaceHolder>" ; } joinAll ( org . multiverse . TestThread [ ] ) { return org . multiverse . TestUtils . joinAll ( ( 5 * 60 ) , threads ) ; }
org . junit . Assert . assertEquals ( count ( workers ) , count ( refs ) )
assocTest2_365 ( ) { com . redhat . lightblue . crud . FindRequest fr = new com . redhat . lightblue . crud . FindRequest ( ) ; fr . setQuery ( query ( "{'field':'A.*.objectType','op':'=','rvalue':'jA'}" ) ) ; fr . setProjection ( projection ( "[{'field':'*','recursive':1},{'field':'A.*','recursive':1}]" ) ) ; fr . setEntityVersion ( new com . redhat . lightblue . EntityVersion ( "jB" , "1.0.1-SNAPSHOT" ) ) ; com . redhat . lightblue . Response response = mediator . find ( fr ) ; System . out . println ( response . getEntityData ( ) ) ; "<AssertPlaceHolder>" ; } getEntityData ( ) { return entityData ; }
org . junit . Assert . assertEquals ( 2 , response . getEntityData ( ) . size ( ) )
aZeroDurationIsZero ( ) { org . libreplan . business . workingday . EffortDuration duration = org . libreplan . business . workingday . EffortDuration . zero ( ) ; "<AssertPlaceHolder>" ; } isZero ( ) { return ( directChargedEffort . isZero ( ) ) && ( indirectChargedEffort . isZero ( ) ) ; }
org . junit . Assert . assertTrue ( duration . isZero ( ) )
testVerwijderStapels ( ) { final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel persoonNationaliteit1Sleutel = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Persoon . class , "persoonNationaliteitSet" , null ) ; persoonNationaliteit1Sleutel . addSleuteldeel ( "nation" , testData . persoonNationaliteit1 . getNationaliteit ( ) . getId ( ) ) ; final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel persoonNationaliteit2Sleutel = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Persoon . class , "persoonNationaliteitSet" , null ) ; persoonNationaliteit1Sleutel . addSleuteldeel ( "nation" , testData . persoonNationaliteit2 . getNationaliteit ( ) . getId ( ) ) ; final nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil verschil1 = new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil ( persoonNationaliteit1Sleutel , testData . persoonNationaliteit1 , null , nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . VerschilType . RIJ_VERWIJDERD , null , null ) ; final nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil verschil2 = new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil ( persoonNationaliteit2Sleutel , testData . persoonNationaliteit2 , null , nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . VerschilType . RIJ_VERWIJDERD , null , null ) ; testData . verwerker . verwerkWijzigingen ( vergelijkerResultaat ( verschil1 , verschil2 ) , testData . persoon , testData . administratieveHandeling ) ; "<AssertPlaceHolder>" ; } getPersoonNationaliteitSet ( ) { return persoonNationaliteitSet ; }
org . junit . Assert . assertTrue ( testData . persoon . getPersoonNationaliteitSet ( ) . isEmpty ( ) )
testRegex3 ( ) { java . lang . String tags = "tag1=value1,tag2=value2,tag3=value3" ; java . lang . StringBuffer pattern = new java . lang . StringBuffer ( ) ; pattern . append ( "(^|.*,)" ) ; pattern . append ( "tag2" ) ; pattern . append ( "=" ) ; pattern . append ( "(value2|value3)" ) ; pattern . append ( "(,.*|$)" ) ; java . util . regex . Pattern p = java . util . regex . Pattern . compile ( pattern . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { done ( ) ; java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; buf . append ( "metric:<sp>" ) . append ( metric ) ; buf . append ( "<sp>tags:<sp>" ) . append ( tags ) ; buf . append ( "<sp>timestamp:<sp>" ) . append ( timestamp ) ; buf . append ( "<sp>count:<sp>" ) . append ( count ( ) ) ; buf . append ( "<sp>min:<sp>" ) . append ( min ( ) ) ; buf . append ( "<sp>max:<sp>" ) . append ( max ( ) ) ; buf . append ( "<sp>sum:<sp>" ) . append ( sum ( ) ) ; buf . append ( "<sp>50p:<sp>" ) . append ( getPercentile ( 50 ) ) ; buf . append ( "<sp>75p:<sp>" ) . append ( getPercentile ( 75 ) ) ; buf . append ( "<sp>99p:<sp>" ) . append ( getPercentile ( 99 ) ) ; return buf . toString ( ) ; }
org . junit . Assert . assertTrue ( p . matcher ( tags ) . matches ( ) )
shouldGetExporterClass ( ) { final uk . gov . gchq . gaffer . operation . export . graph . handler . ExportToOtherGraphHandler handler = new uk . gov . gchq . gaffer . operation . export . graph . handler . ExportToOtherGraphHandler ( ) ; "<AssertPlaceHolder>" ; } getExporterClass ( ) { return uk . gov . gchq . gaffer . operation . export . graph . OtherGraphExporter . class ; }
org . junit . Assert . assertEquals ( uk . gov . gchq . gaffer . operation . export . graph . OtherGraphExporter . class , handler . getExporterClass ( ) )
unmarshalls_filter_with_emptyPrefix ( ) { com . amazonaws . services . s3 . model . BucketLifecycleConfiguration . Rule rule = getRule ( parseLifecycleConfiguration ( com . amazonaws . services . s3 . model . transform . BucketLifecycleSaxUnmarshallerTest . UNKNOWN_STORAGE_CLASS_RESPONSE ) , 2 ) ; com . amazonaws . services . s3 . model . lifecycle . LifecyclePrefixPredicate predicate = ( ( com . amazonaws . services . s3 . model . lifecycle . LifecyclePrefixPredicate ) ( rule . getFilter ( ) . getPredicate ( ) ) ) ; "<AssertPlaceHolder>" ; } getPrefix ( ) { return prefix ; }
org . junit . Assert . assertEquals ( "" , predicate . getPrefix ( ) )
testUnconnectingGroup ( ) { try { org . openscience . cdk . iupac . parser . NomParser . generate ( "7-chloropentane" , org . openscience . cdk . silent . SilentChemObjectBuilder . getInstance ( ) ) ; org . junit . Assert . fail ( "Molecule<sp>was<sp>successfully<sp>generated<sp>but<sp>should<sp>have<sp>thrown<sp>a<sp>ParseException" ) ; } catch ( org . openscience . cdk . iupac . parser . ParseException pe ) { "<AssertPlaceHolder>" ; } catch ( org . openscience . cdk . exception . CDKException exception ) { org . junit . Assert . fail ( exception . getMessage ( ) ) ; } } getInstance ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder result = org . openscience . cdk . silent . SilentChemObjectBuilder . instance ; if ( result == null ) { result = org . openscience . cdk . silent . SilentChemObjectBuilder . instance ; synchronized ( org . openscience . cdk . silent . SilentChemObjectBuilder . LOCK ) { if ( result == null ) { org . openscience . cdk . silent . SilentChemObjectBuilder . instance = result = new org . openscience . cdk . silent . SilentChemObjectBuilder ( ) ; } } } return result ; }
org . junit . Assert . assertTrue ( true )
testGetSplit ( ) { java . util . List < java . util . Map < java . lang . String , java . lang . Object > > expected = com . google . common . collect . ImmutableList . < java . util . Map < java . lang . String , java . lang . Object > > of ( com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( Intrinsic . ID , "key1" , Intrinsic . DELETED , false , "count" , 1234 ) , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( Intrinsic . ID , "key2" , Intrinsic . DELETED , false , "count" , 5678 ) ) ; when ( _server . getSplit ( "table-name" , "split-name" , null , Long . MAX_VALUE , true , ReadConsistency . WEAK ) ) . thenReturn ( expected . iterator ( ) ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > actual = com . google . common . collect . Lists . newArrayList ( com . bazaarvoice . emodb . sor . client . DataStoreStreaming . getSplit ( sorClient ( test . integration . sor . DataStoreJerseyTest . APIKEY_TABLE ) , "table-name" , "split-name" , false , ReadConsistency . WEAK ) ) ; "<AssertPlaceHolder>" ; verify ( _server ) . getSplit ( "table-name" , "split-name" , null , Long . MAX_VALUE , true , ReadConsistency . WEAK ) ; verifyNoMoreInteractions ( _server ) ; } sorClient ( java . lang . String ) { return com . bazaarvoice . emodb . sor . client . DataStoreAuthenticator . proxied ( new com . bazaarvoice . emodb . sor . client . DataStoreClient ( java . net . URI . create ( "/sor/1" ) , new com . bazaarvoice . emodb . common . jersey . dropwizard . JerseyEmoClient ( _resourceTestRule . client ( ) ) ) ) . usingCredentials ( apiKey ) ; }
org . junit . Assert . assertEquals ( actual , expected )
testCheckActualRequestType ( ) { com . erudika . para . utils . filters . MockHttpServletRequest request = new com . erudika . para . utils . filters . MockHttpServletRequest ( ) ; request . setHeader ( CORSFilter . REQUEST_HEADER_ORIGIN , TestConfigs . HTTP_TOMCAT_APACHE_ORG ) ; request . setMethod ( "PUT" ) ; com . erudika . para . utils . filters . CORSFilter corsFilter = new com . erudika . para . utils . filters . CORSFilter ( ) ; corsFilter . init ( com . erudika . para . utils . filters . TestConfigs . getDefaultFilterConfig ( ) ) ; com . erudika . para . utils . filters . CORSFilter . CORSRequestType requestType = corsFilter . checkRequestType ( request ) ; "<AssertPlaceHolder>" ; } checkRequestType ( javax . servlet . http . HttpServletRequest ) { com . erudika . para . utils . filters . CORSFilter . CORSRequestType requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; if ( request == null ) { throw new java . lang . IllegalArgumentException ( "HttpServletRequest<sp>object<sp>is<sp>null" ) ; } java . lang . String originHeader = request . getHeader ( com . erudika . para . utils . filters . CORSFilter . REQUEST_HEADER_ORIGIN ) ; if ( originHeader != null ) { if ( originHeader . isEmpty ( ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else if ( ! ( com . erudika . para . utils . filters . CORSFilter . isValidOrigin ( originHeader ) ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else { java . lang . String method = org . apache . commons . lang3 . StringUtils . trimToEmpty ( request . getMethod ( ) ) ; if ( com . erudika . para . utils . filters . CORSFilter . HTTP_METHODS . contains ( method ) ) { if ( "OPTIONS" . equals ( method ) ) { java . lang . String accessControlRequestMethodHeader = request . getHeader ( com . erudika . para . utils . filters . CORSFilter . REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD ) ; if ( org . apache . commons . lang3 . StringUtils . isNotBlank ( accessControlRequestMethodHeader ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . PRE_FLIGHT ; } else if ( org . apache . commons . lang3 . StringUtils . isWhitespace ( accessControlRequestMethodHeader ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } else if ( ( "GET" . equals ( method ) ) || ( "HEAD" . equals ( method ) ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . SIMPLE ; } else if ( "POST" . equals ( method ) ) { java . lang . String contentType = request . getContentType ( ) ; if ( contentType != null ) { contentType = contentType . toLowerCase ( ) . trim ( ) ; if ( com . erudika . para . utils . filters . CORSFilter . SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES . contains ( contentType ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . SIMPLE ; } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } } else if ( com . erudika . para . utils . filters . CORSFilter . COMPLEX_HTTP_METHODS . contains ( method ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } } } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . NOT_CORS ; } return requestType ; }
org . junit . Assert . assertEquals ( CORSFilter . CORSRequestType . ACTUAL , requestType )
testFindByCriteria ( ) { try { java . lang . String columnName = "code" ; java . lang . String value = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCrisisResourceFacadeImp . crisisCode ; java . util . List < qa . qcri . aidr . dbmanager . dto . CollectionDTO > result = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCrisisResourceFacadeImp . crisisResourceFacadeImp . findByCriteria ( columnName , value ) ; "<AssertPlaceHolder>" ; } catch ( qa . qcri . aidr . common . exception . PropertyNotSetException ex ) { qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCrisisResourceFacadeImp . logger . error ( ( "Property<sp>not<sp>set<sp>exception<sp>while<sp>finding<sp>crisis<sp>by<sp>criteria<sp>" + ( ex . getMessage ( ) ) ) ) ; } } getCode ( ) { return code ; }
org . junit . Assert . assertEquals ( qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCrisisResourceFacadeImp . crisisCode , result . get ( 0 ) . getCode ( ) )
countWith ( ) { this . iterables . forEach ( com . gs . collections . impl . block . factory . Procedures . cast ( ( each ) -> { int result = com . gs . collections . impl . utility . Iterate . countWith ( each , com . gs . collections . impl . block . factory . Predicates2 . greaterThan ( ) , 3 ) ; "<AssertPlaceHolder>" ; } ) ) ; } greaterThan ( ) { return ( ( com . gs . collections . impl . block . factory . Predicates2 < T , T > ) ( com . gs . collections . impl . block . factory . Predicates2 . GREATER_THAN ) ) ; }
org . junit . Assert . assertEquals ( 2 , result )
userCanDeleteBranchTest ( ) { final org . guvnor . common . services . project . model . WorkspaceProject project = getProject ( ) ; doReturn ( true ) . when ( libraryPermissions ) . userCanDeleteProject ( any ( ) ) ; "<AssertPlaceHolder>" ; } userCanDeleteBranch ( org . guvnor . common . services . project . model . WorkspaceProject ) { return ( ( ( userIsAtLeast ( ContributorType . ADMIN , project . getRepository ( ) . getContributors ( ) ) ) || ( userIsAtLeast ( ContributorType . ADMIN , project . getOrganizationalUnit ( ) . getContributors ( ) ) ) ) || ( userCanDeleteProject ( project ) ) ) && ( ! ( project . getBranch ( ) . getName ( ) . equals ( "master" ) ) ) ; }
org . junit . Assert . assertTrue ( libraryPermissions . userCanDeleteBranch ( project ) )
test2 ( ) { introclassJava . median_3b2376ab_003 mainClass = new introclassJava . median_3b2376ab_003 ( ) ; java . lang . String expected = "Please<sp>enter<sp>3<sp>numbers<sp>separated<sp>by<sp>spaces<sp>><sp>6<sp>is<sp>the<sp>median" ; mainClass . scanner = new java . util . Scanner ( "2<sp>8<sp>6" ) ; mainClass . exec ( ) ; java . lang . String out = mainClass . output . replace ( "\n" , "<sp>" ) . trim ( ) ; "<AssertPlaceHolder>" ; } replace ( int , java . lang . Object ) { org . mozilla . javascript . xmlimpl . XMLList xlChildToReplace = child ( index ) ; if ( ( xlChildToReplace . length ( ) ) > 0 ) { org . mozilla . javascript . xmlimpl . XML childToReplace = xlChildToReplace . item ( 0 ) ; insertChildAfter ( childToReplace , xml ) ; removeChild ( index ) ; } return this ; }
org . junit . Assert . assertEquals ( expected . replace ( "<sp>" , "" ) , out . replace ( "<sp>" , "" ) )
testValidateInterpolate2 ( ) { org . orbisgis . legend . analyzer . symbolizers . PointSymbolizerAnalyzer psa = new org . orbisgis . legend . analyzer . symbolizers . PointSymbolizerAnalyzer ( new org . orbisgis . coremap . renderer . se . PointSymbolizer ( ) ) ; org . orbisgis . legend . analyzer . Interpolate2Real ir = new org . orbisgis . legend . analyzer . Interpolate2Real ( new org . orbisgis . legend . analyzer . RealLiteral ( 0 ) ) ; org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ip = new org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ( ) ; ip . setData ( 0 ) ; ip . setValue ( new org . orbisgis . legend . analyzer . RealLiteral ( 0 ) ) ; ir . addInterpolationPoint ( ip ) ; org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ip2 = new org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ( ) ; ip2 . setData ( 1 ) ; ip2 . setValue ( new org . orbisgis . legend . analyzer . RealLiteral ( 1 ) ) ; ir . addInterpolationPoint ( ip2 ) ; org . orbisgis . legend . analyzer . RealFunction rf = new org . orbisgis . legend . analyzer . RealFunction ( RealFunction . Operators . SQRT ) ; try { rf . addOperand ( new org . orbisgis . legend . analyzer . RealAttribute ( ) ) ; } catch ( org . orbisgis . coremap . renderer . se . parameter . ParameterException pe ) { throw new java . lang . IllegalStateException ( ( "We've<sp>just<sp>failed<sp>at<sp>giving" + "an<sp>operand<sp>to<sp>a<sp>log.<sp>Something<sp>must<sp>be<sp>going<sp>REALLY<sp>wrong..." ) , pe ) ; } ir . setLookupValue ( rf ) ; "<AssertPlaceHolder>" ; } validateInterpolateForProportionalPoint ( org . orbisgis . coremap . renderer . se . parameter . real . RealParameter ) { if ( rp instanceof org . orbisgis . coremap . renderer . se . parameter . real . Interpolate2Real ) { org . orbisgis . coremap . renderer . se . parameter . real . RealParameter look = ( ( org . orbisgis . coremap . renderer . se . parameter . real . Interpolate2Real ) ( rp ) ) . getLookupValue ( ) ; if ( look instanceof org . orbisgis . coremap . renderer . se . parameter . real . RealFunction ) { org . orbisgis . coremap . renderer . se . parameter . real . RealFunction rf = ( ( org . orbisgis . coremap . renderer . se . parameter . real . RealFunction ) ( look ) ) ; java . util . List < org . orbisgis . coremap . renderer . se . parameter . real . RealParameter > ops = rf . getOperands ( ) ; if ( ( ( ( ! ( ops . isEmpty ( ) ) ) && ( rf . getOperator ( ) . equals ( RealFunction . Operators . SQRT ) ) ) && ( ( ops . size ( ) ) == 1 ) ) && ( ( ops . get ( 0 ) ) instanceof org . orbisgis . coremap . renderer . se . parameter . real . RealAttribute ) ) { return true ; } } } return false ; }
org . junit . Assert . assertTrue ( psa . validateInterpolateForProportionalPoint ( ir ) )
serializeCollection ( ) { java . util . Collection < java . lang . String > input = java . util . Arrays . asList ( "some" , "any" ) ; java . lang . String expected = "[\"some\",\"any\"]" ; java . lang . String output = serdes . serialize ( input , null ) ; "<AssertPlaceHolder>" ; } serialize ( java . util . Collection , io . reinert . requestor . serialization . SerializationContext ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( "<myList>" ) ; for ( io . reinert . requestor . examples . showcase . activity . SerializationActivity . MyObject myObject : myObjectCollection ) { sb . append ( serialize ( myObject , context ) ) ; } return sb . append ( "</myList>" ) . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , output )
testEmpty ( ) { cn . jpush . api . push . model . notification . IosNotification ios = cn . jpush . api . push . model . notification . IosNotification . newBuilder ( ) . build ( ) ; com . google . gson . JsonObject json = new com . google . gson . JsonObject ( ) ; json . add ( "sound" , new com . google . gson . JsonPrimitive ( "" ) ) ; json . add ( "badge" , new com . google . gson . JsonPrimitive ( "+1" ) ) ; "<AssertPlaceHolder>" ; } toJSON ( ) { cn . jpush . api . report . model . JsonObject jsonObject = new cn . jpush . api . report . model . JsonObject ( ) ; if ( ( msgId ) != ( - 1L ) ) { jsonObject . addProperty ( cn . jpush . api . report . model . CheckMessagePayload . MSG_ID , msgId ) ; } if ( null != ( registrationIds ) ) { cn . jpush . api . report . model . JsonArray jsonArray = new cn . jpush . api . report . model . JsonArray ( ) ; for ( java . lang . String rid : registrationIds ) { jsonArray . add ( new cn . jpush . api . report . model . JsonPrimitive ( rid ) ) ; } jsonObject . add ( cn . jpush . api . report . model . CheckMessagePayload . REGISTRATION_IDS , jsonArray ) ; } if ( null != ( date ) ) { jsonObject . addProperty ( cn . jpush . api . report . model . CheckMessagePayload . DATE , date ) ; } return jsonObject ; }
org . junit . Assert . assertEquals ( "" , json , ios . toJSON ( ) )
testMinimalExample ( ) { java . lang . String obama = "Barack<sp>Obama" ; java . lang . String obamaURL = "http://dbpedia.org/resource/Barack_Obama" ; java . lang . String merkel = "Angela<sp>Merkel" ; java . lang . String merkelURL = "Angela<sp>Merkel" 0 ; java . lang . String city = "Berlin" ; java . lang . String cityURL = "http://dbpedia.org/resource/Berlin" ; java . util . HashMap < java . lang . String , java . lang . String > correct = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; correct . put ( obama , obamaURL ) ; correct . put ( merkel , merkelURL ) ; correct . put ( city , cityURL ) ; java . lang . String preAnnotatedText = ( ( ( ( ( "<entity>" + obama ) + "</entity><sp>visits<sp><entity>" ) + merkel ) + "</entity><sp>in<sp><entity>" ) + city ) + "</entity>." ; org . aksw . agdistis . algorithm . NEDAlgo_HITS agdistis = new org . aksw . agdistis . algorithm . NEDAlgo_HITS ( ) ; org . aksw . agdistis . datatypes . Document d = org . aksw . agdistis . webapp . GetDisambiguation . textToDocument ( preAnnotatedText ) ; agdistis . run ( d , null ) ; org . aksw . agdistis . datatypes . NamedEntitiesInText namedEntities = d . getNamedEntitiesInText ( ) ; java . util . HashMap < org . aksw . agdistis . datatypes . NamedEntityInText , java . lang . String > results = new java . util . HashMap < org . aksw . agdistis . datatypes . NamedEntityInText , java . lang . String > ( ) ; for ( org . aksw . agdistis . datatypes . NamedEntityInText namedEntity : namedEntities ) { java . lang . String disambiguatedURL = namedEntity . getNamedEntityUri ( ) ; results . put ( namedEntity , disambiguatedURL ) ; } for ( org . aksw . agdistis . datatypes . NamedEntityInText namedEntity : namedEntities ) { java . lang . String disambiguatedURL = namedEntity . getNamedEntityUri ( ) ; System . out . println ( ( ( ( namedEntity . getLabel ( ) ) + "<sp>-><sp>" ) + disambiguatedURL ) ) ; "<AssertPlaceHolder>" ; } } getLabel ( ) { return label ; }
org . junit . Assert . assertTrue ( correct . get ( namedEntity . getLabel ( ) ) . equals ( disambiguatedURL ) )
readsQueueSizeFromConfiguration ( ) { final org . everrest . core . impl . EverrestConfiguration configuration = new org . everrest . core . impl . EverrestConfiguration ( ) ; configuration . setAsynchronousQueueSize ( 555 ) ; asynchronousJobPool = new org . everrest . core . impl . async . AsynchronousJobPool ( configuration ) ; "<AssertPlaceHolder>" ; } getMaxQueueSize ( ) { return maxQueueSize ; }
org . junit . Assert . assertEquals ( 555 , asynchronousJobPool . getMaxQueueSize ( ) )
deveObterIdLoteComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . NFEnviaEventoRetorno eventoRetorno = new com . fincatto . documentofiscal . nfe400 . classes . evento . NFEnviaEventoRetorno ( ) ; final java . lang . String idLote = "99" ; eventoRetorno . setIdLote ( idLote ) ; "<AssertPlaceHolder>" ; } getIdLote ( ) { return this . idLote ; }
org . junit . Assert . assertEquals ( idLote , eventoRetorno . getIdLote ( ) )
testGetArchimateElement ( ) { "<AssertPlaceHolder>" ; } getArchimateElement ( ) { return archimateElementEClass ; }
org . junit . Assert . assertSame ( element , object . getArchimateElement ( ) )
iterateEmptyHeadersShouldThrow ( ) { java . util . Iterator < Map . Entry < java . lang . CharSequence , java . lang . CharSequence > > iterator = io . netty . handler . codec . DefaultHeadersTest . newInstance ( ) . iterator ( ) ; "<AssertPlaceHolder>" ; iterator . next ( ) ; } hasNext ( ) { return itr . hasNext ( ) ; }
org . junit . Assert . assertFalse ( iterator . hasNext ( ) )
testModelAndView ( ) { com . blade . mvc . ui . ModelAndView modelAndView = new com . blade . mvc . ui . ModelAndView ( ) ; "<AssertPlaceHolder>" ; } getModel ( ) { return model ; }
org . junit . Assert . assertEquals ( 0 , modelAndView . getModel ( ) . size ( ) )
testCommandLine ( ) { try { org . apache . hadoop . fs . FileUtil . fullyDelete ( OUTPUT_DIR . getAbsoluteFile ( ) ) ; } catch ( java . lang . Exception e ) { } try { createInput ( ) ; boolean mayExit = false ; job = new org . apache . hadoop . streaming . StreamJob ( genArgs ( ) , mayExit ) ; job . go ( ) ; org . apache . hadoop . streaming . File outFile = new org . apache . hadoop . streaming . File ( OUTPUT_DIR , "part-00000" ) . getAbsoluteFile ( ) ; java . lang . String output = org . apache . hadoop . streaming . StreamUtil . slurp ( outFile ) ; outFile . delete ( ) ; System . err . println ( ( "outEx1=" + ( outputExpect ) ) ) ; System . err . println ( ( "<sp>out1=" + output ) ) ; System . err . println ( ( "<sp>equals=" + ( outputExpect . compareTo ( output ) ) ) ) ; "<AssertPlaceHolder>" ; } finally { INPUT_FILE . delete ( ) ; org . apache . hadoop . fs . FileUtil . fullyDelete ( OUTPUT_DIR . getAbsoluteFile ( ) ) ; } } compareTo ( java . util . concurrent . Delayed ) { if ( ( o . getClass ( ) ) != ( org . apache . hadoop . hdfs . HftpFileSystem . RenewAction . class ) ) { throw new java . lang . IllegalArgumentException ( "Illegal<sp>comparision<sp>to<sp>non-RenewAction" ) ; } org . apache . hadoop . hdfs . HftpFileSystem . RenewAction other = ( ( org . apache . hadoop . hdfs . HftpFileSystem . RenewAction ) ( o ) ) ; return ( timestamp ) < ( other . timestamp ) ? - 1 : ( timestamp ) == ( other . timestamp ) ? 0 : 1 ; }
org . junit . Assert . assertEquals ( outputExpect , output )
testConstructorUnnamed ( ) { java . util . List < java . lang . String > errors = com . ibm . ws . microprofile . config . fat . tests . CDIBrokenInjectionTest . server . findStringsInLogs ( "ConfigUnnamedConstructorInjectionBean.*The<sp>property<sp>name<sp>must<sp>be<sp>specified<sp>for<sp>Constructor<sp>and<sp>Method<sp>configuration<sp>property<sp>injection" ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertTrue ( ( ( errors . size ( ) ) > 0 ) )
testToString ( ) { java . lang . String expectedStatisticName1 = "Min" ; de . metanome . algorithm_integration . results . basic_statistic_values . BasicStatisticValueString expectedStatisticValue1 = new de . metanome . algorithm_integration . results . basic_statistic_values . BasicStatisticValueString ( "minValue" ) ; java . lang . String expectedStatisticName2 = "Max" ; de . metanome . algorithm_integration . results . basic_statistic_values . BasicStatisticValueString expectedStatisticValue2 = new de . metanome . algorithm_integration . results . basic_statistic_values . BasicStatisticValueString ( "maxValue" ) ; de . metanome . algorithm_integration . ColumnIdentifier expectedColumn = new de . metanome . algorithm_integration . ColumnIdentifier ( "table42" , "column23" ) ; de . metanome . algorithm_integration . ColumnCombination expectedColumnCombination = new de . metanome . algorithm_integration . ColumnCombination ( expectedColumn ) ; de . metanome . algorithm_integration . results . BasicStatistic statistic = new de . metanome . algorithm_integration . results . BasicStatistic ( expectedColumn ) ; statistic . addStatistic ( expectedStatisticName1 , expectedStatisticValue1 ) ; statistic . addStatistic ( expectedStatisticName2 , expectedStatisticValue2 ) ; java . lang . String expectedString1 = ( ( ( ( ( ( ( ( expectedColumnCombination + ( BasicStatistic . COLUMN_VALUE_SEPARATOR ) ) + expectedStatisticName2 ) + ( BasicStatistic . NAME_COLUMN_SEPARATOR ) ) + expectedStatisticValue2 ) + ( BasicStatistic . STATISTIC_SEPARATOR ) ) + expectedStatisticName1 ) + ( BasicStatistic . NAME_COLUMN_SEPARATOR ) ) + expectedStatisticValue1 ) + ( BasicStatistic . STATISTIC_SEPARATOR ) ; java . lang . String expectedString2 = ( ( ( ( ( ( ( ( expectedColumnCombination + ( BasicStatistic . COLUMN_VALUE_SEPARATOR ) ) + expectedStatisticName1 ) + ( BasicStatistic . NAME_COLUMN_SEPARATOR ) ) + expectedStatisticValue1 ) + ( BasicStatistic . STATISTIC_SEPARATOR ) ) + expectedStatisticName2 ) + ( BasicStatistic . NAME_COLUMN_SEPARATOR ) ) + expectedStatisticValue2 ) + ( BasicStatistic . STATISTIC_SEPARATOR ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } de . metanome . algorithm_helper . data_structures . LongPair other = ( ( de . metanome . algorithm_helper . data_structures . LongPair ) ( obj ) ) ; if ( ( first ) != ( other . first ) ) { return false ; } return ( second ) == ( other . second ) ; }
org . junit . Assert . assertTrue ( ( ( expectedString1 . equals ( statistic . toString ( ) ) ) || ( expectedString2 . equals ( statistic . toString ( ) ) ) ) )
testGetTag ( ) { co . nstant . in . cbor . model . DataItem di = new co . nstant . in . cbor . model . DataItem ( MajorType . UNSIGNED_INTEGER ) ; di . setTag ( new co . nstant . in . cbor . model . Tag ( 1 ) ) ; co . nstant . in . cbor . model . Tag t = di . getTag ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( 1L , t . getValue ( ) )
binaryHasNoSoname ( ) { org . junit . Assume . assumeThat ( com . facebook . buck . util . environment . Platform . detect ( ) , org . hamcrest . Matchers . oneOf ( Platform . FREEBSD , Platform . LINUX ) ) ; com . facebook . buck . testutil . integration . ProjectWorkspace workspace = com . facebook . buck . testutil . integration . TestDataHelper . createProjectWorkspaceForScenario ( this , "shared_library" , tmp ) ; workspace . setUp ( ) ; java . nio . file . Path binaryPath = workspace . buildAndReturnOutput ( "//:binary" ) ; "<AssertPlaceHolder>" ; } getSoname ( java . nio . file . Path ) { return com . facebook . buck . cxx . ElfFile . getSoname ( com . facebook . buck . cxx . ElfFile . mapReadOnly ( elfFilePath ) ) ; }
org . junit . Assert . assertThat ( com . facebook . buck . cxx . ElfFile . getSoname ( binaryPath ) , org . hamcrest . Matchers . equalTo ( java . util . Optional . empty ( ) ) )
twoGroupsSameRoleShouldExist ( ) { net . jforum . entities . Group g1 = new net . jforum . entities . Group ( ) ; g1 . addRole ( this . newRole ( "role1" ) ) ; net . jforum . entities . Group g2 = new net . jforum . entities . Group ( ) ; g2 . addRole ( this . newRole ( "role1" ) ) ; net . jforum . security . RoleManager manager = new net . jforum . security . RoleManager ( ) ; manager . setGroups ( java . util . Arrays . asList ( g1 , g2 ) ) ; "<AssertPlaceHolder>" ; } roleExists ( java . lang . String ) { return ( this . get ( name ) ) != null ; }
org . junit . Assert . assertTrue ( manager . roleExists ( "role1" ) )
testCreateInstance ( ) { com . huawei . streaming . cql . executor . windowcreater . WindowCreator creater = new com . huawei . streaming . cql . executor . windowcreater . EventTimeBatchWindowCreator ( ) ; creater . createInstance ( createWindow ( ) , initSchema ( ) , null ) ; "<AssertPlaceHolder>" ; } initSchema ( ) { java . util . List < com . huawei . streaming . api . streams . Schema > schemas = new java . util . ArrayList < com . huawei . streaming . api . streams . Schema > ( ) ; com . huawei . streaming . api . streams . Schema s1 = new com . huawei . streaming . api . streams . Schema ( "s1" ) ; s1 . setStreamName ( "s1" ) ; s1 . addCol ( new com . huawei . streaming . api . streams . Column ( "id" , java . lang . String . class ) ) ; s1 . addCol ( new com . huawei . streaming . api . streams . Column ( "name" , java . lang . String . class ) ) ; schemas . add ( s1 ) ; return schemas ; }
org . junit . Assert . assertTrue ( true )
lastModified_null_returnNewDate ( ) { java . util . Date result = com . adobe . acs . commons . wcm . comparisons . impl . Properties . lastModified ( null ) ; "<AssertPlaceHolder>" ; } lastModified ( org . apache . sling . api . resource . Resource ) { if ( resource != null ) { return resource . getValueMap ( ) . get ( NameConstants . PN_LAST_MOD , new java . util . Date ( ) ) ; } return new java . util . Date ( ) ; }
org . junit . Assert . assertNotNull ( result )
datumIngangVoorDatumEinde ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangBijhoudingsautorisatie toegang = new nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangBijhoudingsautorisatie ( new nl . bzk . algemeenbrp . dal . domein . brp . entity . PartijRol ( new nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij ( "partij1" , "000001" ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Rol . AFNEMER ) , new nl . bzk . algemeenbrp . dal . domein . brp . entity . Bijhoudingsautorisatie ( false ) ) ; toegang . setDatumIngang ( 20160605 ) ; toegang . setDatumEinde ( 20160606 ) ; "<AssertPlaceHolder>" ; } errorCount ( nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie ) { final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "toegang" ) ; subject . validate ( toegang , errors ) ; return errors . getErrorCount ( ) ; }
org . junit . Assert . assertEquals ( 0 , errorCount ( toegang ) )
testRefreshLayoutMainInitial ( ) { org . talend . components . localio . fixedflowinput . FixedFlowInputProperties properties = new org . talend . components . localio . fixedflowinput . FixedFlowInputProperties ( "test" ) ; properties . init ( ) ; properties . refreshLayout ( properties . getForm ( Form . MAIN ) ) ; boolean mainIsHidden = properties . getForm ( Form . MAIN ) . getWidget ( "schemaFlow" ) . isHidden ( ) ; "<AssertPlaceHolder>" ; } isHidden ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertFalse ( mainIsHidden )
givenGroupsAreEmpty_whenGetMostSpecificMatchingGroup_thenReturnsAbsent ( ) { java . util . List < java . util . List < com . brandwatch . robots . matching . Matchable < java . lang . String > > > groups = java . util . Collections . emptyList ( ) ; java . lang . String agentString = "googlebot" ; com . google . common . base . Optional < java . util . List < com . brandwatch . robots . matching . Matchable < java . lang . String > > > result = utilities . getMostSpecificMatchingGroup ( groups , agentString ) ; "<AssertPlaceHolder>" ; } getMostSpecificMatchingGroup ( java . lang . Iterable , T ) { checkNotNull ( groups , "groups<sp>is<sp>null" ) ; checkNotNull ( target , "target<sp>is<sp>null" ) ; com . google . common . base . Optional < Group > argMax = absent ( ) ; com . google . common . base . Optional < java . lang . Double > maxSpecificity = absent ( ) ; for ( Group group : groups ) { com . google . common . base . Optional < java . lang . Double > specificity = getMostSpecificMatchSpecificity ( group , target ) ; if ( ( specificity . isPresent ( ) ) && ( ( ! ( maxSpecificity . isPresent ( ) ) ) || ( ( specificity . get ( ) ) > ( maxSpecificity . get ( ) ) ) ) ) { maxSpecificity = specificity ; argMax = of ( group ) ; } } return argMax ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( com . google . common . base . Optional . < java . util . List < com . brandwatch . robots . matching . Matchable < java . lang . String > > > absent ( ) ) )
testOptimizationFromJson ( ) { org . deeplearning4j . earlystopping . EarlyStoppingConfiguration < org . deeplearning4j . nn . graph . ComputationGraph > esConf = new org . deeplearning4j . earlystopping . EarlyStoppingConfiguration . Builder < org . deeplearning4j . nn . graph . ComputationGraph > ( ) . epochTerminationConditions ( new org . deeplearning4j . earlystopping . termination . MaxEpochsTerminationCondition ( 100 ) ) . scoreCalculator ( new org . deeplearning4j . earlystopping . scorecalc . DataSetLossCalculatorCG ( new org . deeplearning4j . datasets . iterator . impl . IrisDataSetIterator ( 150 , 150 ) , true ) ) . modelSaver ( new org . deeplearning4j . earlystopping . saver . InMemoryModelSaver < org . deeplearning4j . nn . graph . ComputationGraph > ( ) ) . build ( ) ; org . deeplearning4j . arbiter . ComputationGraphSpace cgs = new org . deeplearning4j . arbiter . ComputationGraphSpace . Builder ( ) . optimizationAlgo ( OptimizationAlgorithm . STOCHASTIC_GRADIENT_DESCENT ) . updater ( new org . deeplearning4j . arbiter . conf . updater . AdaMaxSpace ( new org . deeplearning4j . arbiter . optimize . parameter . continuous . ContinuousParameterSpace ( 1.0E-4 , 0.1 ) ) ) . l2 ( new org . deeplearning4j . arbiter . optimize . parameter . continuous . ContinuousParameterSpace ( 1.0E-4 , 0.01 ) ) . addInputs ( "in" ) . setInputTypes ( org . deeplearning4j . nn . conf . inputs . InputType . feedForward ( 4 ) ) . addLayer ( "first" , new org . deeplearning4j . arbiter . layers . DenseLayerSpace . Builder ( ) . nIn ( 4 ) . nOut ( new org . deeplearning4j . arbiter . optimize . parameter . integer . IntegerParameterSpace ( 2 , 10 ) ) . activation ( new org . deeplearning4j . arbiter . optimize . parameter . discrete . DiscreteParameterSpace ( org . nd4j . linalg . activations . Activation . RELU , org . nd4j . linalg . activations . Activation . TANH ) ) . build ( ) , "in" ) . addLayer ( "out" , new org . deeplearning4j . arbiter . layers . OutputLayerSpace . Builder ( ) . nOut ( 3 ) . activation ( Activation . SOFTMAX ) . lossFunction ( LossFunctions . LossFunction . MCXENT ) . build ( ) , "first" ) . setOutputs ( "out" ) . earlyStoppingConfiguration ( esConf ) . build ( ) ; java . util . Map < java . lang . String , java . lang . Object > commands = new java . util . HashMap ( ) ; commands . put ( DataSetIteratorFactoryProvider . FACTORY_KEY , org . deeplearning4j . arbiter . util . TestDataFactoryProviderMnist . class . getCanonicalName ( ) ) ; org . deeplearning4j . arbiter . optimize . api . CandidateGenerator candidateGenerator = new org . deeplearning4j . arbiter . optimize . generator . RandomSearchGenerator ( cgs , commands ) ; org . deeplearning4j . arbiter . optimize . api . data . DataProvider dataProvider = new org . deeplearning4j . arbiter . optimize . api . data . DataSetIteratorFactoryProvider ( ) ; org . deeplearning4j . arbiter . optimize . config . OptimizationConfiguration configuration = new org . deeplearning4j . arbiter . optimize . config . OptimizationConfiguration . Builder ( ) . candidateGenerator ( candidateGenerator ) . dataProvider ( dataProvider ) . scoreFunction ( new org . deeplearning4j . arbiter . scoring . impl . TestSetLossScoreFunction ( ) ) . terminationConditions ( new org . deeplearning4j . arbiter . optimize . api . termination . MaxTimeCondition ( 2 , java . util . concurrent . TimeUnit . MINUTES ) , new org . deeplearning4j . arbiter . optimize . api . termination . MaxCandidatesCondition ( 100 ) ) . build ( ) ; java . lang . String json = configuration . toJson ( ) ; org . deeplearning4j . arbiter . optimize . config . OptimizationConfiguration loadConf = org . deeplearning4j . arbiter . optimize . config . OptimizationConfiguration . fromJson ( json ) ; "<AssertPlaceHolder>" ; } fromJson ( java . lang . String ) { try { return org . deeplearning4j . arbiter . optimize . serde . jackson . JsonMapper . getMapper ( ) . readValue ( json , org . deeplearning4j . arbiter . optimize . config . OptimizationConfiguration . class ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertEquals ( configuration , loadConf )
containsObject ( ) { final org . hisp . dhis . category . Category category1 = new org . hisp . dhis . category . Category ( ) ; final org . hisp . dhis . category . Category category2 = new org . hisp . dhis . category . Category ( ) ; container . add ( category1 ) ; container . add ( category2 ) ; "<AssertPlaceHolder>" ; } containsObject ( org . hisp . dhis . common . IdentifiableObject ) { return objectsIndexMap . containsKey ( object ) ; }
org . junit . Assert . assertTrue ( container . containsObject ( category1 ) )