input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
checkVisitation ( ) { testVisitor = new org . eclipse . ice . tests . datastructures . TestVisitor ( ) ; org . eclipse . ice . tests . datastructures . TableComponentTester . tableComponent = new org . eclipse . ice . datastructures . form . TableComponent ( ) ; org . eclipse . ice . tests . datastructures . TableComponentTester . tableComponent . accept ( testVisitor ) ; "<AssertPlaceHolder>" ; } wasVisited ( ) { return visited ; }
org . junit . Assert . assertTrue ( testVisitor . wasVisited ( ) )
testMissingConfig ( ) { java . lang . System . clearProperty ( "rio.home" ) ; java . lang . System . clearProperty ( ResolverConfiguration . RESOLVER_CONFIG ) ; org . rioproject . resolver . ResolverConfiguration resolverConfiguration = new org . rioproject . resolver . ResolverConfiguration ( ) ; java . lang . String jarName = resolverConfiguration . getResolverJar ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( jarName )
testLoadFromEnv ( ) { try { java . lang . System . setProperty ( Constants . ENV_PROPERTY_NAME , ( ( java . lang . System . getProperty ( "user.dir" ) ) + "/src/test/resources/config/rio.env" ) ) ; org . rioproject . config . RioProperties . load ( ) ; java . lang . String locators = java . lang . System . getProperty ( Constants . LOCATOR_PROPERTY_NAME ) ; "<AssertPlaceHolder>" ; } finally { java . lang . System . clearProperty ( Constants . ENV_PROPERTY_NAME ) ; } } load ( ) { java . io . File rioEnv ; java . lang . String rioEnvFileName = java . lang . System . getProperty ( Constants . ENV_PROPERTY_NAME , java . lang . System . getenv ( Constants . ENV_PROPERTY_NAME ) ) ; if ( rioEnvFileName == null ) { java . io . File rioRoot = new java . io . File ( java . lang . System . getProperty ( "user.home" ) , ".rio" ) ; rioEnv = new java . io . File ( rioRoot , "rio.env" ) ; if ( rioEnv . exists ( ) ) { org . rioproject . config . RioProperties . loadAndSetProperties ( rioEnv ) ; } else { java . lang . String rioHome = java . lang . System . getProperty ( "rio.home" , java . lang . System . getenv ( "RIO_HOME" ) ) ; if ( rioHome != null ) { rioEnv = new java . io . File ( rioHome , "config/rio.env" ) ; if ( rioEnv . exists ( ) ) { org . rioproject . config . RioProperties . loadAndSetProperties ( rioEnv ) ; } else { System . err . println ( ( ( rioEnv . getPath ( ) ) + "<sp>not<sp>found,<sp>skipping" ) ) ; } } else { System . err . println ( "RIO_HOME<sp>environment<sp>not<sp>set" ) ; } } } else { rioEnv = new java . io . File ( rioEnvFileName ) ; if ( rioEnv . exists ( ) ) { org . rioproject . config . RioProperties . loadAndSetProperties ( rioEnv ) ; } } }
org . junit . Assert . assertNotNull ( locators )
testDeleteProductAttributeMedia ( ) { try { java . lang . Boolean result = runFlowAndGetPayload ( "delete-product-attribute-media" ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( org . mule . modules . tests . ConnectorTestUtils . getStackTrace ( e ) ) ; } }
org . junit . Assert . assertTrue ( result )
testIOReadParameterized ( ) { com . streamsets . pipeline . api . FileRef fileRef = com . streamsets . pipeline . lib . io . fileref . FileRefTestUtil . getLocalFileRef ( testDir , true , null , null ) ; long fileSize = java . nio . file . Files . size ( java . nio . file . Paths . get ( com . streamsets . pipeline . lib . io . fileref . FileRefTestUtil . getSourceFilePath ( testDir ) ) ) ; long remainingFileSize = fileSize ; try ( java . io . InputStream is = fileRef . createInputStream ( context , java . io . InputStream . class ) ) { "<AssertPlaceHolder>" ; int bytesRead ; byte [ ] b = new byte [ 10 ] ; while ( ( bytesRead = is . read ( b , 0 , b . length ) ) > 0 ) { remainingFileSize -= bytesRead ; checkStateDuringReads ( fileSize , remainingFileSize , is ) ; } checkStateAfterReadCompletion ( fileSize , remainingFileSize , is ) ; } } getRemainingBytes ( T extends com . streamsets . pipeline . lib . io . fileref . AutoCloseable ) { return ( ( com . codahale . metrics . Counter ) ( org . mockito . internal . util . reflection . Whitebox . getInternalState ( stream , "remainingBytesCounter" ) ) ) . getCount ( ) ; }
org . junit . Assert . assertEquals ( remainingFileSize , getRemainingBytes ( is ) )
testGetResName ( ) { org . openscience . cdk . interfaces . IPDBAtom atom = ( ( org . openscience . cdk . interfaces . IPDBAtom ) ( newChemObject ( ) ) ) ; atom . setSymbol ( "C" ) ; atom . setResName ( "PHE" ) ; "<AssertPlaceHolder>" ; } getResName ( ) { return resName ; }
org . junit . Assert . assertEquals ( "PHE" , atom . getResName ( ) )
nullEntrys ( ) { org . mockito . Mockito . when ( filereader . fileExist ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( filereader . readAllLine ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( null ) ; bluetoothReader . setFileReader ( filereader ) ; java . util . List < com . att . aro . core . peripheral . pojo . BluetoothInfo > bluetoothInfo = bluetoothReader . readData ( "/" , 0 , 0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return sessionTable . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( bluetoothInfo . size ( ) ) == 0 ) )
testGetSetName ( ) { com . swingsane . preferences . model . Scanner scannerPreferences = new com . swingsane . preferences . model . Scanner ( ) ; scannerPreferences . setName ( com . swingsane . preferences . device . ScannerPreferencesTest . MOCK_NAME ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( com . swingsane . preferences . device . ScannerPreferencesTest . MOCK_NAME , scannerPreferences . getName ( ) )
count ( ) { query . where ( title . eq ( "Jurassic<sp>Park" ) ) ; "<AssertPlaceHolder>" ; } fetchCount ( ) { return innerCount ( ) ; }
org . junit . Assert . assertEquals ( 1 , query . fetchCount ( ) )
testFunLine ( ) { rapaio . graphics . plot . Plot plot = funLine ( ( x ) -> x * x , color ( 1 ) ) . funLine ( Math :: log1p , color ( 2 ) ) . funLine ( ( x ) -> ( java . lang . Math . sin ( java . lang . Math . pow ( x , 3 ) ) ) + 5 , color ( 3 ) , points ( 10000 ) ) . hLine ( 5 , color ( Color . LIGHT_GRAY ) ) . xLim ( 0 , 10 ) . yLim ( 0 , 10 ) ; rapaio . io . JavaIO . storeToFile ( plot , "/tmp/tmp.ser" ) ; if ( rapaio . graphics . ImageGraphicsTest . show ) rapaio . sys . WS . draw ( plot ) ; if ( rapaio . graphics . ImageGraphicsTest . regenerate ) rapaio . graphics . base . ImageUtility . saveImage ( plot , 500 , 400 , ( ( rapaio . graphics . ImageGraphicsTest . root ) + "/rapaio/graphics/funLine-test.png" ) ) ; java . awt . image . BufferedImage bi1 = rapaio . graphics . base . ImageUtility . buildImage ( plot , 500 , 400 ) ; java . awt . image . BufferedImage bi2 = javax . imageio . ImageIO . read ( this . getClass ( ) . getResourceAsStream ( "funLine-test.png" ) ) ; "<AssertPlaceHolder>" ; } bufferedImagesEqual ( java . awt . image . BufferedImage , java . awt . image . BufferedImage ) { if ( ( ( img1 . getWidth ( ) ) == ( img2 . getWidth ( ) ) ) && ( ( img1 . getHeight ( ) ) == ( img2 . getHeight ( ) ) ) ) { return true ; } return false ; }
org . junit . Assert . assertTrue ( bufferedImagesEqual ( bi1 , bi2 ) )
returnsEmptyIteratorIfAskedToIterateFromEnd ( ) { final java . lang . String stream = generateStreamName ( ) ; eventstore . appendToStream ( stream , ExpectedVersion . NO_STREAM , newTestEvents ( 20 ) ) . join ( ) ; java . util . Iterator < com . github . msemys . esjc . ResolvedEvent > iterator = eventstore . iterateAllEventsForward ( Position . END , 1 , false ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return iterator ( ) . hasNext ( ) ; }
org . junit . Assert . assertFalse ( iterator . hasNext ( ) )
testOnPlayerThrowPotionNotAllowed ( ) { when ( island . isAllowed ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . any ( ) ) ) . thenReturn ( false ) ; org . bukkit . entity . ThrownPotion entity = mock ( org . bukkit . entity . ThrownPotion . class ) ; when ( entity . getLocation ( ) ) . thenReturn ( location ) ; when ( entity . getShooter ( ) ) . thenReturn ( player ) ; org . bukkit . event . entity . ProjectileLaunchEvent e = new org . bukkit . event . entity . ProjectileLaunchEvent ( entity ) ; tl . onPlayerThrowPotion ( e ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( notifier ) . notify ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . eq ( "protection.protected" ) ) ; } isCancelled ( ) { return cancelled ; }
org . junit . Assert . assertTrue ( e . isCancelled ( ) )
testSanitizerGoodTelLink ( ) { java . lang . String input = "<a<sp>href=\"tel:123456\">Link</a>" ; "<AssertPlaceHolder>" ; } sanitize ( java . lang . String ) { return com . github . bordertech . wcomponents . util . HtmlSanitizerUtil . sanitize ( input , false ) ; }
org . junit . Assert . assertEquals ( input , com . github . bordertech . wcomponents . util . HtmlSanitizerUtil . sanitize ( input ) )
testMulticastHops ( ) { options . setSocketOpt ( ZMQ . ZMQ_MULTICAST_HOPS , 12 ) ; "<AssertPlaceHolder>" ; } getSocketOpt ( int ) { switch ( option ) { case ZMQ . ZMQ_SNDHWM : return sendHwm ; case ZMQ . ZMQ_RCVHWM : return recvHwm ; case ZMQ . ZMQ_AFFINITY : return affinity ; case ZMQ . ZMQ_IDENTITY : return identity ; case ZMQ . ZMQ_RATE : return rate ; case ZMQ . ZMQ_RECOVERY_IVL : return recoveryIvl ; case ZMQ . ZMQ_SNDBUF : return sndbuf ; case ZMQ . ZMQ_RCVBUF : return rcvbuf ; case ZMQ . ZMQ_TOS : return tos ; case ZMQ . ZMQ_TYPE : return type ; case ZMQ . ZMQ_LINGER : return linger ; case ZMQ . ZMQ_RECONNECT_IVL : return reconnectIvl ; case ZMQ . ZMQ_RECONNECT_IVL_MAX : return reconnectIvlMax ; case ZMQ . ZMQ_BACKLOG : return backlog ; case ZMQ . ZMQ_MAXMSGSIZE : return maxMsgSize ; case ZMQ . ZMQ_MULTICAST_HOPS : return multicastHops ; case ZMQ . ZMQ_RCVTIMEO : return recvTimeout ; case ZMQ . ZMQ_SNDTIMEO : return sendTimeout ; case ZMQ . ZMQ_IPV4ONLY : return ! ( ipv6 ) ; case ZMQ . ZMQ_IPV6 : return ipv6 ; case ZMQ . ZMQ_TCP_KEEPALIVE : return tcpKeepAlive ; case ZMQ . ZMQ_IMMEDIATE : return immediate ; case ZMQ . ZMQ_DELAY_ATTACH_ON_CONNECT : return ! ( immediate ) ; case ZMQ . ZMQ_SOCKS_PROXY : return socksProxyAddress ; case ZMQ . ZMQ_TCP_KEEPALIVE_CNT : case ZMQ . ZMQ_TCP_KEEPALIVE_IDLE : case ZMQ . ZMQ_TCP_KEEPALIVE_INTVL : return 0 ; case ZMQ . ZMQ_MECHANISM : return mechanism ; case ZMQ . ZMQ_PLAIN_SERVER : return ( asServer ) && ( ( mechanism ) == ( zmq . io . mechanism . Mechanisms . PLAIN ) ) ; case ZMQ . ZMQ_PLAIN_USERNAME : return plainUsername ; case ZMQ . ZMQ_PLAIN_PASSWORD : return plainPassword ; case ZMQ . ZMQ_ZAP_DOMAIN : return zapDomain ; case ZMQ . ZMQ_LAST_ENDPOINT : return lastEndpoint ; case ZMQ . ZMQ_CURVE_SERVER : return ( asServer ) && ( ( mechanism ) == ( zmq . io . mechanism . Mechanisms . CURVE ) ) ; case ZMQ . ZMQ_CURVE_PUBLICKEY : return curvePublicKey ; case ZMQ . ZMQ_CURVE_SERVERKEY : return curveServerKey ; case ZMQ . ZMQ_CURVE_SECRETKEY : return curveSecretKey ; case ZMQ . ZMQ_CONFLATE : return conflate ; case ZMQ . ZMQ_GSSAPI_SERVER : return ( asServer ) && ( ( mechanism ) == ( zmq . io . mechanism . Mechanisms . GSSAPI ) ) ; case ZMQ . ZMQ_GSSAPI_PRINCIPAL : return gssPrincipal ; case ZMQ . ZMQ_GSSAPI_SERVICE_PRINCIPAL : return gssServicePrincipal ; case ZMQ . ZMQ_GSSAPI_PLAINTEXT : return gssPlaintext ; case ZMQ . ZMQ_HANDSHAKE_IVL : return handshakeIvl ; case ZMQ . ZMQ_HEARTBEAT_IVL : return heartbeatInterval ; case ZMQ . ZMQ_HEARTBEAT_TIMEOUT : return heartbeatTimeout ; case ZMQ . ZMQ_HEARTBEAT_TTL : return ( heartbeatTtl ) * 100 ; case ZMQ . ZMQ_HEARTBEAT_CONTEXT : return heartbeatContext ; case ZMQ . ZMQ_MSG_ALLOCATOR : return allocator ; case ZMQ . ZMQ_MSG_ALLOCATION_HEAP_THRESHOLD : if ( ( allocator ) instanceof zmq . msg . MsgAllocatorThreshold ) { zmq . msg . MsgAllocatorThreshold all = ( ( zmq . msg . MsgAllocatorThreshold ) ( allocator ) ) ; return all . threshold ; } return - 1 ; case ZMQ . ZMQ_SELECTOR_PROVIDERCHOOSER : return selectorChooser ; default : throw new java . lang . IllegalArgumentException ( ( "option=" + option ) ) ; } }
org . junit . Assert . assertThat ( options . getSocketOpt ( ZMQ . ZMQ_MULTICAST_HOPS ) , org . hamcrest . CoreMatchers . is ( ( ( java . lang . Object ) ( 12 ) ) ) )
shouldBeCaseInsensitiveExceptResource ( ) { final com . calclab . emite . core . XmppURI uri1 = com . calclab . emite . core . XmppURI . uri ( "xmpp:test@EXAMPLE/res" ) ; final com . calclab . emite . core . XmppURI uri2 = com . calclab . emite . core . XmppURI . uri ( "tesT@example/res" ) ; "<AssertPlaceHolder>" ; } uri ( java . lang . String ) { if ( com . google . common . base . Strings . isNullOrEmpty ( uri ) ) return null ; if ( com . calclab . emite . core . XmppURI . cache . containsKey ( uri ) ) return com . calclab . emite . core . XmppURI . cache . get ( uri ) ; java . lang . String node = null ; java . lang . String domain = null ; java . lang . String resource = null ; final int atIndex = ( uri . indexOf ( '@' ) ) + 1 ; if ( atIndex > 0 ) { node = uri . substring ( 0 , ( atIndex - 1 ) ) ; if ( ( node . length ( ) ) == 0 ) return null ; } final int barIndex = uri . indexOf ( '/' , atIndex ) ; if ( atIndex == barIndex ) return null ; if ( barIndex > 0 ) { domain = uri . substring ( atIndex , barIndex ) ; resource = uri . substring ( ( barIndex + 1 ) ) ; } else { domain = uri . substring ( atIndex ) ; } if ( ( domain . length ( ) ) == 0 ) return null ; final com . calclab . emite . core . XmppURI result = com . calclab . emite . core . XmppURI . uri ( node , domain , resource ) ; com . calclab . emite . core . XmppURI . cache . put ( uri , result ) ; return result ; }
org . junit . Assert . assertEquals ( uri1 , uri2 )
testTrustChain ( ) { final ch . cyberduck . core . s3 . Host host = new ch . cyberduck . core . s3 . Host ( new ch . cyberduck . core . s3 . S3Protocol ( ) , new ch . cyberduck . core . s3 . S3Protocol ( ) . getDefaultHostname ( ) , new ch . cyberduck . core . s3 . Credentials ( java . lang . System . getProperties ( ) . getProperty ( "s3.key" ) , java . lang . System . getProperties ( ) . getProperty ( "s3.secret" ) ) ) ; final java . util . concurrent . atomic . AtomicBoolean verified = new java . util . concurrent . atomic . AtomicBoolean ( ) ; final ch . cyberduck . core . s3 . S3Session session = new ch . cyberduck . core . s3 . S3Session ( host , new ch . cyberduck . core . ssl . DefaultX509TrustManager ( ) { @ ch . cyberduck . core . s3 . Override public void verify ( final java . lang . String hostname , final java . security . cert . X509Certificate [ ] certs , final java . lang . String cipher ) throws java . security . cert . CertificateException { verified . set ( true ) ; super . verify ( hostname , certs , cipher ) ; } } , new ch . cyberduck . core . ssl . KeychainX509KeyManager ( host , new ch . cyberduck . core . s3 . DisabledCertificateStore ( ) ) ) ; final ch . cyberduck . core . s3 . LoginConnectionService c = new ch . cyberduck . core . s3 . LoginConnectionService ( new ch . cyberduck . core . s3 . DisabledLoginCallback ( ) , new ch . cyberduck . core . s3 . DisabledHostKeyCallback ( ) , new ch . cyberduck . core . s3 . DisabledPasswordStore ( ) , new ch . cyberduck . core . s3 . DisabledProgressListener ( ) ) ; c . connect ( session , ch . cyberduck . core . s3 . PathCache . empty ( ) , new ch . cyberduck . core . s3 . DisabledCancelCallback ( ) ) ; "<AssertPlaceHolder>" ; session . close ( ) ; } get ( ) { try { final ch . cyberduck . core . Path home = new ch . cyberduck . core . shared . DefaultHomeFinderService ( session ) . find ( ) ; if ( ! ( home . isRoot ( ) ) ) { final ch . cyberduck . core . sds . io . swagger . client . model . Node node = new ch . cyberduck . core . sds . io . swagger . client . api . NodesApi ( session . getClient ( ) ) . getFsNode ( java . lang . Long . parseLong ( nodeid . getFileid ( home , new ch . cyberduck . core . DisabledListProgressListener ( ) ) ) , org . apache . commons . lang3 . StringUtils . EMPTY , null ) ; if ( null == ( node . getQuota ( ) ) ) { ch . cyberduck . core . sds . SDSQuotaFeature . log . warn ( java . lang . String . format ( "No<sp>quota<sp>set<sp>for<sp>node<sp>%s" , home ) ) ; } else { return new ch . cyberduck . core . sds . Space ( node . getSize ( ) , ( ( node . getQuota ( ) ) - ( node . getSize ( ) ) ) ) ; } } final ch . cyberduck . core . sds . io . swagger . client . model . CustomerData info = new ch . cyberduck . core . sds . io . swagger . client . api . UserApi ( session . getClient ( ) ) . getCustomerInfo ( org . apache . commons . lang3 . StringUtils . EMPTY , null ) ; return new ch . cyberduck . core . sds . Space ( info . getSpaceUsed ( ) , ( ( info . getSpaceLimit ( ) ) - ( info . getSpaceUsed ( ) ) ) ) ; } catch ( ch . cyberduck . core . sds . io . swagger . client . ApiException e ) { throw new ch . cyberduck . core . sds . SDSExceptionMappingService ( ) . map ( "Failure<sp>to<sp>read<sp>attributes<sp>of<sp>{0}" , e , new ch . cyberduck . core . Path ( java . lang . String . valueOf ( Path . DELIMITER ) , java . util . EnumSet . of ( Path . Type . volume , Path . Type . directory ) ) ) ; } }
org . junit . Assert . assertTrue ( verified . get ( ) )
testCreateFromLocalCapabilitiesUrl ( ) { java . net . URL configUrl = org . deegree . remoteows . wmts . RemoteWMTSProviderTest . class . getResource ( "example.xml" ) ; java . io . File file = new java . io . File ( configUrl . toURI ( ) ) ; org . deegree . remoteows . wmts . RemoteWMTS wmts = ( ( org . deegree . remoteows . wmts . RemoteWMTS ) ( org . deegree . workspace . WorkspaceUtils . activateFromFile ( workspace , org . deegree . remoteows . RemoteOWSProvider . class , "example" , file ) ) ) ; "<AssertPlaceHolder>" ; } activateFromFile ( org . deegree . workspace . Workspace , java . lang . Class , java . lang . String , java . io . File ) { org . deegree . workspace . standard . DefaultResourceLocation < ? extends org . deegree . workspace . Resource > loc ; org . deegree . workspace . ResourceIdentifier < T > identifier = new org . deegree . workspace . standard . DefaultResourceIdentifier < T > ( providerClass , id ) ; loc = new org . deegree . workspace . standard . DefaultResourceLocation < T > ( content , identifier ) ; workspace . add ( loc ) ; workspace . prepare ( identifier ) ; return workspace . init ( identifier , null ) ; }
org . junit . Assert . assertNotNull ( wmts )
testCheckPlanCalcScore_TravelingPt ( ) { org . matsim . core . config . Config config = new org . matsim . core . config . Config ( ) ; config . addCoreModules ( ) ; config . planCalcScore ( ) . getModes ( ) . get ( TransportMode . pt ) . setMarginalUtilityOfTraveling ( 3.0 ) ; org . matsim . testcases . utils . LogCounter logger = new org . matsim . testcases . utils . LogCounter ( org . apache . log4j . Level . WARN ) ; try { logger . activiate ( ) ; new org . matsim . core . config . consistency . ConfigConsistencyCheckerImpl ( ) . checkPlanCalcScore ( config ) ; "<AssertPlaceHolder>" ; } finally { logger . deactiviate ( ) ; } } getWarnCount ( ) { return this . cntWARN ; }
org . junit . Assert . assertEquals ( 1 , logger . getWarnCount ( ) )
testJmsPortPresence_shouldBeExportedWithCorrectId ( ) { org . openengsb . core . api . remote . OutgoingPort serviceWithId = utilsService . getServiceWithId ( org . openengsb . core . api . remote . OutgoingPort . class , "jms-json" , 60000 ) ; "<AssertPlaceHolder>" ; } getServiceWithId ( java . lang . String , java . lang . String , long ) { org . osgi . framework . Filter filter = org . openengsb . core . util . FilterUtils . makeFilter ( className , java . lang . String . format ( "(%s=%s)" , org . osgi . framework . Constants . SERVICE_PID , id ) ) ; return getService ( filter , timeout ) ; }
org . junit . Assert . assertNotNull ( serviceWithId )
serialize ( ) { java . util . Map < java . lang . String , java . lang . Object > message = new java . util . HashMap ( ) ; message . put ( "foo" , "bar" ) ; message . put ( "baz" , 354.99 ) ; byte [ ] bytes = serializer . serialize ( "foo" , message ) ; java . lang . Object deserialized = this . objectMapper . readValue ( bytes , java . lang . Object . class ) ; "<AssertPlaceHolder>" ; } serialize ( java . lang . String , T ) { if ( data == null ) { return null ; } try { return objectMapper . writeValueAsBytes ( data ) ; } catch ( java . lang . Exception e ) { throw new org . apache . kafka . common . errors . SerializationException ( "Error<sp>serializing<sp>JSON<sp>message" , e ) ; } }
org . junit . Assert . assertEquals ( message , deserialized )
setValueMessage ( ) { org . openhab . binding . zwave . internal . protocol . commandclass . ZWaveColorCommandClass cls = ( ( org . openhab . binding . zwave . internal . protocol . commandclass . ZWaveColorCommandClass ) ( getCommandClass ( CommandClass . COMMAND_CLASS_SWITCH_COLOR ) ) ) ; org . openhab . binding . zwave . internal . protocol . transaction . ZWaveCommandClassTransactionPayload msg ; byte [ ] expectedResponseV1 = new byte [ ] { 51 , 5 , 1 , 3 , 80 } ; cls . setVersion ( 1 ) ; msg = cls . setValueMessage ( 3 , 80 ) ; "<AssertPlaceHolder>" ; } getPayloadBuffer ( ) { return payload ; }
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( msg . getPayloadBuffer ( ) , expectedResponseV1 ) )
testGetV8ResultString ( ) { java . lang . Object result = com . eclipsesource . v8 . utils . V8ObjectUtils . getV8Result ( v8 , "Seven" ) ; "<AssertPlaceHolder>" ; } getV8Result ( com . eclipsesource . v8 . V8 , java . lang . Object ) { if ( value == null ) { return null ; } java . util . Map < java . lang . Object , com . eclipsesource . v8 . V8Value > cache = new java . util . Hashtable < java . lang . Object , com . eclipsesource . v8 . V8Value > ( ) ; try { java . lang . Object result = com . eclipsesource . v8 . utils . V8ObjectUtils . getV8Result ( v8 , value , cache ) ; if ( result instanceof com . eclipsesource . v8 . V8Value ) { return ( ( com . eclipsesource . v8 . V8Value ) ( result ) ) . twin ( ) ; } return result ; } finally { for ( com . eclipsesource . v8 . V8Value v8Object : cache . values ( ) ) { v8Object . close ( ) ; } } }
org . junit . Assert . assertEquals ( "Seven" , result )
protonMessageToIoTHubMessageWithInputName ( org . apache . qpid . proton . message . impl . MessageImpl , org . apache . qpid . proton . amqp . messaging . MessageAnnotations , org . apache . qpid . proton . amqp . messaging . Data ) { final java . lang . String expectedInputName = "some<sp>input<sp>name" ; final java . util . Map < org . apache . qpid . proton . amqp . Symbol , java . lang . Object > mockedAnnotationsMap = new java . util . HashMap ( ) ; mockedAnnotationsMap . put ( mockit . Deencapsulation . newInstance ( org . apache . qpid . proton . amqp . Symbol . class , mockit . Deencapsulation . getField ( tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceTelemetry . class , "INPUT_NAME_PROPERTY_KEY" ) ) , expectedInputName ) ; new mockit . NonStrictExpectations ( ) { { mockMessage . getBody ( ) ; result = mockData ; mockMessage . getMessageAnnotations ( ) ; result = mockedAnnotations ; mockedAnnotations . getValue ( ) ; result = mockedAnnotationsMap ; } } ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceTelemetry amqpsDeviceTelemetry = mockit . Deencapsulation . newInstance ( tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceTelemetry . class , mockDeviceClientConfig ) ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . Message message = mockit . Deencapsulation . invoke ( amqpsDeviceTelemetry , "protonMessageToIoTHubMessage" , mockMessage ) ; "<AssertPlaceHolder>" ; } getInputName ( ) { return inputName ; }
org . junit . Assert . assertEquals ( expectedInputName , message . getInputName ( ) )
testZero ( ) { uk . gov . dstl . baleen . schedules . Repeat scheduler = create ( "count" , "0" ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return await ( ) ; }
org . junit . Assert . assertFalse ( scheduler . hasNext ( ) )
testConfigure_WithPropertyValues ( ) { final gov . hhs . fha . nhinc . messaging . client . CONNECTTestClient < gov . hhs . fha . nhinc . messaging . service . port . TestServicePortType > testClient = new gov . hhs . fha . nhinc . messaging . client . CONNECTTestClient ( new gov . hhs . fha . nhinc . messaging . service . port . TestServicePortDescriptor ( ) ) ; final gov . hhs . fha . nhinc . messaging . service . ServiceEndpoint < gov . hhs . fha . nhinc . messaging . service . port . TestServicePortType > serviceEndpoint = testClient . getServiceEndpoint ( ) ; final gov . hhs . fha . nhinc . properties . PropertyAccessor mockPropAccessor = mock ( gov . hhs . fha . nhinc . properties . PropertyAccessor . class ) ; final gov . hhs . fha . nhinc . common . nhinccommon . AssertionType assertion = new gov . hhs . fha . nhinc . common . nhinccommon . AssertionType ( ) ; final gov . hhs . fha . nhinc . messaging . service . decorator . HttpHeaderServiceEndpointDecorator headerDecorator = new gov . hhs . fha . nhinc . messaging . service . decorator . HttpHeaderServiceEndpointDecorator ( serviceEndpoint , assertion ) { @ gov . hhs . fha . nhinc . messaging . service . decorator . Override protected gov . hhs . fha . nhinc . properties . PropertyAccessor getPropertyAccessor ( ) { return mockPropAccessor ; } } ; final java . lang . String customHeaderName = "customName" ; final java . lang . String customHeaderValue = "customValue" ; final java . util . Set < java . lang . String > headerNames = new java . util . HashSet ( ) ; headerNames . add ( ( ( ( gov . hhs . fha . nhinc . nhinclib . NhincConstants . CUSTOM_HTTP_HEADERS ) + "." ) + customHeaderName ) ) ; when ( mockPropAccessor . getProperty ( NhincConstants . GATEWAY_PROPERTY_FILE , NhincConstants . KEEP_ALIVE_PROP ) ) . thenReturn ( "True" ) ; when ( mockPropAccessor . getPropertyNames ( NhincConstants . GATEWAY_PROPERTY_FILE ) ) . thenReturn ( headerNames ) ; when ( mockPropAccessor . getProperty ( NhincConstants . GATEWAY_PROPERTY_FILE , ( ( ( gov . hhs . fha . nhinc . nhinclib . NhincConstants . CUSTOM_HTTP_HEADERS ) + "." ) + customHeaderName ) ) ) . thenReturn ( customHeaderValue ) ; headerDecorator . configure ( ) ; validateConfiguration ( headerDecorator ) ; final javax . xml . ws . BindingProvider bp = ( ( javax . xml . ws . BindingProvider ) ( headerDecorator . getPort ( ) ) ) ; final java . util . Map < java . lang . String , java . util . List < java . lang . String > > bpMap = ( ( java . util . Map < java . lang . String , java . util . List < java . lang . String > > ) ( bp . getRequestContext ( ) . get ( NhincConstants . CUSTOM_HTTP_HEADERS ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { gov . hhs . fha . nhinc . directconfig . entity . Address result = null ; org . hibernate . Session session = null ; org . hibernate . Query query ; if ( name != null ) { try { session = gov . hhs . fha . nhinc . directconfig . dao . helpers . DaoUtils . getSession ( ) ; query = session . createQuery ( "SELECT<sp>DISTINCT<sp>a<sp>from<sp>Address<sp>a<sp>WHERE<sp>UPPER(a.emailAddress)<sp>=<sp>:emailAddress" ) ; result = ( ( gov . hhs . fha . nhinc . directconfig . entity . Address ) ( query . setParameter ( "emailAddress" , name . toUpperCase ( java . util . Locale . getDefault ( ) ) ) . uniqueResult ( ) ) ) ; } finally { gov . hhs . fha . nhinc . directconfig . dao . helpers . DaoUtils . closeSession ( session ) ; } } return result ; }
org . junit . Assert . assertTrue ( bpMap . containsKey ( "customName" ) )
testFactoryWithWrongType ( ) { copyShapefiles ( "shapes/archsites.shp" ) ; java . io . File f = copyShapefiles ( "shapes/bugsites.shp" ) ; tempDir = f . getParentFile ( ) ; java . util . Map params = new java . util . HashMap ( ) ; params . put ( ShapefileDataStoreFactory . URLP . key , org . geotools . data . DataUtilities . fileToURL ( tempDir ) ) ; params . put ( ShapefileDataStoreFactory . FILE_TYPE . key , "abcdef..." ) ; org . geotools . data . DataStore store = org . geotools . data . DataStoreFinder . getDataStore ( params ) ; "<AssertPlaceHolder>" ; } getDataStore ( java . util . Map ) { java . util . Iterator < org . geotools . data . DataStoreFactorySpi > ps = org . geotools . data . DataStoreFinder . getAvailableDataStores ( ) ; org . geotools . data . DataAccess < ? extends org . opengis . feature . type . FeatureType , ? extends org . opengis . feature . Feature > dataStore ; dataStore = org . geotools . data . DataAccessFinder . getDataStore ( params , ps ) ; return ( ( org . geotools . data . DataStore ) ( dataStore ) ) ; }
org . junit . Assert . assertNull ( store )
CallInstanceMethodIndirect_SuperSuperClass ( ) { java . lang . String fromClass = "domain.indirect.violatingfrom.CallInstanceMethodIndirect_SuperSuperClass" ; java . lang . String toClass = "technology.direct.dao.CallInstanceSuperClassDAO" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Call" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; }
org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , true ) )
testGetTypeFromTypeDateHour ( ) { java . util . Calendar cal = org . sagebionetworks . logging . s3 . LogKeyUtils . getClaendarUTC ( ) ; cal . set ( 1999 , 0 , 15 , 22 , 49 , 12 ) ; java . lang . String key = org . sagebionetworks . logging . s3 . LogKeyUtils . createKeyForFile ( 123 , "test-type.date.log.gz" , cal . getTimeInMillis ( ) ) ; java . lang . String typeDateHour = org . sagebionetworks . logging . s3 . LogKeyUtils . getTypeDateAndHourFromKey ( key ) ; java . lang . String type = org . sagebionetworks . logging . s3 . LogKeyUtils . getTypeFromTypeDateHour ( typeDateHour ) ; java . lang . String expected = "test-type" ; "<AssertPlaceHolder>" ; } getTypeFromTypeDateHour ( java . lang . String ) { java . lang . String [ ] split = typeDateHour . split ( "/" ) ; return split [ 0 ] ; }
org . junit . Assert . assertEquals ( expected , type )
testExceptionHandlerWithFailIgnored ( ) { java . lang . Exception res = null ; it . geosolutions . tool . errorhandling . ActionExceptionHandlerTest . TestConfiguration testConf = new it . geosolutions . tool . errorhandling . ActionExceptionHandlerTest . TestConfiguration ( ) ; testConf . setFailIgnored ( true ) ; try { it . geosolutions . tool . errorhandling . ActionExceptionHandler . handleError ( testConf , new it . geosolutions . tool . errorhandling . ActionExceptionHandlerTest . TestAction ( ) , "an<sp>error<sp>message." ) ; } catch ( it . geosolutions . geobatch . flow . event . action . ActionException e ) { org . junit . Assert . fail ( ) ; } "<AssertPlaceHolder>" ; } handleError ( it . geosolutions . geobatch . configuration . event . action . ActionConfiguration , it . geosolutions . geobatch . flow . event . action . BaseAction , java . lang . String ) { if ( conf == null ) { if ( it . geosolutions . tool . errorhandling . ActionExceptionHandler . LOGGER . isErrorEnabled ( ) ) { it . geosolutions . tool . errorhandling . ActionExceptionHandler . LOGGER . error ( it . geosolutions . tool . errorhandling . ActionExceptionHandler . NULL_CONF_ERROR ) ; } throw new java . lang . IllegalArgumentException ( it . geosolutions . tool . errorhandling . ActionExceptionHandler . NULL_CONF_ERROR ) ; } final java . lang . String ownerMsg = ( owner == null ) ? it . geosolutions . tool . errorhandling . ActionExceptionHandler . UNKNOWN_CLASS : owner . getClass ( ) . getName ( ) ; if ( ( msg == null ) || ( msg . isEmpty ( ) ) ) { msg = it . geosolutions . tool . errorhandling . ActionExceptionHandler . UNKNOWN_MSG ; } java . lang . StringBuilder fullMsg = new java . lang . StringBuilder ( ) ; fullMsg . append ( "Error<sp>in<sp>Class:<sp>" ) . append ( ownerMsg ) . append ( "<sp>-<sp>Message<sp>is:<sp>" ) . append ( msg ) ; if ( ! ( conf . isFailIgnored ( ) ) ) { if ( it . geosolutions . tool . errorhandling . ActionExceptionHandler . LOGGER . isErrorEnabled ( ) ) { it . geosolutions . tool . errorhandling . ActionExceptionHandler . LOGGER . error ( fullMsg . toString ( ) ) ; } it . geosolutions . geobatch . flow . event . action . ActionException ex = new it . geosolutions . geobatch . flow . event . action . ActionException ( owner , msg ) ; if ( owner != null ) { java . util . Iterator iter = owner . getListeners ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { java . lang . Object el = iter . next ( ) ; if ( el instanceof it . geosolutions . geobatch . flow . event . ProgressListenerForwarder ) { ( ( it . geosolutions . geobatch . flow . event . ProgressListenerForwarder ) ( el ) ) . failed ( ex ) ; } } } throw ex ; } else { if ( it . geosolutions . tool . errorhandling . ActionExceptionHandler . LOGGER . isWarnEnabled ( ) ) { it . geosolutions . tool . errorhandling . ActionExceptionHandler . LOGGER . warn ( fullMsg . toString ( ) ) ; } } }
org . junit . Assert . assertTrue ( ( res == null ) )
testCollectionsSortMultipleColumnsDescending ( ) { com . liferay . portal . kernel . model . EmailAddress emailAddress1 = newEmailAddress ( 1 , newDate ( 0 , 1 , 2012 ) , "abc@liferay.com" ) ; com . liferay . portal . kernel . model . EmailAddress emailAddress2 = newEmailAddress ( 2 , newDate ( 0 , 2 , 2012 ) , "abc@liferay.com" ) ; java . util . List < com . liferay . portal . kernel . model . EmailAddress > expectedList = new java . util . ArrayList ( ) ; expectedList . add ( emailAddress2 ) ; expectedList . add ( emailAddress1 ) ; java . util . List < com . liferay . portal . kernel . model . EmailAddress > actualList = new java . util . ArrayList ( ) ; actualList . add ( emailAddress1 ) ; actualList . add ( emailAddress2 ) ; com . liferay . portal . kernel . util . OrderByComparator < com . liferay . portal . kernel . model . EmailAddress > obc = com . liferay . portal . kernel . util . OrderByComparatorFactoryUtil . create ( EmailAddressModelImpl . TABLE_NAME , "address" , false , "createDate" , false ) ; java . util . Collections . sort ( actualList , obc ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( expectedList . toString ( ) , actualList . toString ( ) )
testIsLocalJobExecutionBothUnavailable ( ) { final javax . management . DynamicMBean mockEndpointInfo = mockery . mock ( javax . management . DynamicMBean . class ) ; final com . ibm . websphere . kernel . server . ServerInfoMBean mockServerInfo = mockery . mock ( com . ibm . websphere . kernel . server . ServerInfoMBean . class ) ; final com . ibm . jbatch . container . ws . WSJobExecution mockWSJobExecution = mockery . mock ( com . ibm . jbatch . container . ws . WSJobExecution . class ) ; final java . lang . String defaultHostname = "def.com" ; final java . lang . String userDir = "/wlp/usr/" ; final java . lang . String serverName = "myserver" ; final java . lang . String jobExecRestUrl = BatchLocationServiceImpl . BatchRestUrlUnavailable ; final java . lang . String jobExecServerId = ( ( defaultHostname + "/" ) + userDir ) + serverName ; mockery . checking ( new org . jmock . Expectations ( ) { { allowing ( mockWSJobExecution ) . getRestUrl ( ) ; will ( returnValue ( jobExecRestUrl ) ) ; oneOf ( mockWSJobExecution ) . getServerId ( ) ; will ( returnValue ( jobExecServerId ) ) ; } } ) ; com . ibm . jbatch . container . ws . impl . BatchLocationServiceImpl batchLocationService = new com . ibm . jbatch . container . ws . impl . BatchLocationServiceImpl ( ) ; "<AssertPlaceHolder>" ; } isLocalJobExecution ( long ) { javax . batch . runtime . JobExecution jobExecution = javax . batch . runtime . BatchRuntime . getJobOperator ( ) . getJobExecution ( executionId ) ; return jobExecution instanceof com . ibm . jbatch . container . ws . WSJobExecution ? isLocalJobExecution ( ( ( com . ibm . jbatch . container . ws . WSJobExecution ) ( jobExecution ) ) ) : true ; }
org . junit . Assert . assertTrue ( batchLocationService . isLocalJobExecution ( mockWSJobExecution ) )
testProcessSongBadLine ( ) { java . lang . String testTitle = "testTitle" ; org . bff . javampd . processor . TitleTagProcessor titleTagProcessor = new org . bff . javampd . processor . TitleTagProcessor ( ) ; org . bff . javampd . song . MPDSong song = new org . bff . javampd . song . MPDSong ( "testFile" , null ) ; java . lang . String line = "BadTitle:" + testTitle ; titleTagProcessor . processTag ( song , line ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return title ; }
org . junit . Assert . assertNull ( song . getTitle ( ) )
testInsertRoles ( ) { org . joice . mvc . dao . domain . SysRoles role = new org . joice . mvc . dao . domain . SysRoles ( ) ; role . setRole ( "PD" ) ; role . setDescription ( "" ) ; role . setAvailable ( true ) ; org . joice . mvc . dao . domain . SysRoles createRole = roleService . createRole ( role ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertNotNull ( createRole . getId ( ) )
testMergeParentWithoutPublishingParent ( ) { publish . setResolver ( "1" ) ; publish . setUpdate ( true ) ; publish . setOrganisation ( "apache" ) ; publish . setModule ( "resolve-extends" ) ; publish . setRevision ( "1.0" ) ; publish . setPubrevision ( "1.2" ) ; publish . setStatus ( "release" ) ; publish . addArtifactspattern ( "test/java/org/apache/ivy/ant/ivy-extends-multiconf.xml" ) ; publish . execute ( ) ; java . io . File published = new java . io . File ( "test/repositories/1/apache/resolve-extends/ivys/ivy-1.2.xml" ) ; "<AssertPlaceHolder>" ; checkPublishedFile ( published , "ivy-extends-merged.xml" ) ; } exists ( ) { return file . exists ( ) ; }
org . junit . Assert . assertTrue ( published . exists ( ) )
objectsWithFetchSpecificationRespectsFetchLimit ( ) { com . wounit . rules . MockEditingContext editingContext = new com . wounit . rules . MockEditingContext ( TEST_MODEL_NAME ) ; for ( int i = 0 ; i < 10 ; i ++ ) { com . wounit . model . FooEntity . createFooEntity ( editingContext ) ; } when ( mockFetchSpecification . fetchLimit ( ) ) . thenReturn ( 5 ) ; @ com . wounit . rules . SuppressWarnings ( "unchecked" ) com . webobjects . foundation . NSArray < com . wounit . model . FooEntity > result = editingContext . objectsWithFetchSpecification ( mockFetchSpecification ) ; "<AssertPlaceHolder>" ; } createFooEntity ( com . wounit . model . EOEditingContext ) { com . wounit . model . FooEntity eo = ( ( com . wounit . model . FooEntity ) ( com . wounit . model . EOUtilities . createAndInsertInstance ( editingContext , com . wounit . model . _FooEntity . ENTITY_NAME ) ) ) ; return eo ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 5 ) )
testMethodNoParamsSuccessful ( ) { japicmp . filter . JavadocLikeBehaviorFilter filter = new japicmp . filter . JavadocLikeBehaviorFilter ( "japicmp.Test#method()" ) ; javassist . CtClass ctClass = japicmp . util . CtClassBuilder . create ( ) . name ( "japicmp.Test" ) . addToClassPool ( new javassist . ClassPool ( ) ) ; javassist . CtBehavior ctBehavior = japicmp . util . CtMethodBuilder . create ( ) . name ( "method" ) . parameters ( new javassist . CtClass [ ] { } ) . addToClass ( ctClass ) ; "<AssertPlaceHolder>" ; } matches ( javassist . CtField ) { javassist . CtClass declaringClass = ctField . getDeclaringClass ( ) ; java . lang . String className = declaringClass . getName ( ) ; if ( ! ( this . patternClass . matcher ( className ) . matches ( ) ) ) { return false ; } java . lang . String fieldName = ctField . getName ( ) ; return this . patternField . matcher ( fieldName ) . matches ( ) ; }
org . junit . Assert . assertThat ( filter . matches ( ctBehavior ) , org . hamcrest . core . Is . is ( true ) )
recordExpectationsOnFinalMockField ( ) { mockit . FinalMockFieldsTest . AnotherCollaborator collaborator = new mockit . FinalMockFieldsTest . AnotherCollaborator ( ) ; new mockit . Expectations ( ) { { mock2 . doSomething ( ) ; times = 1 ; } } ; collaborator . doSomething ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return strVal ; }
org . junit . Assert . assertEquals ( 0 , collaborator . getValue ( ) )
testSearchEntryWithoutResults ( ) { loadTestFunctions ( ) ; searchService . searchEntry ( "SOME_OTHER_FUNCTION" , searchCallback ) ; verify ( searchCallback ) . afterSearch ( searchResultsCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return rootPath ; }
org . junit . Assert . assertEquals ( 0 , searchResultsCaptor . getValue ( ) . size ( ) )
initModelData_NoImageDefined ( ) { profile . getUser ( ) . getUserRoles ( ) . add ( UserRoleType . ORGANIZATION_ADMIN ) ; ctrl . initModelData ( profile ) ; org . oscm . ui . profile . EditProfileModel model = ctrl . model ; "<AssertPlaceHolder>" ; } isOrganizationImageDefined ( ) { return organizationImageDefined ; }
org . junit . Assert . assertFalse ( model . isOrganizationImageDefined ( ) )
vdmEncode ( ) { dk . dma . ais . message . AisMessage12 msg12 = new dk . dma . ais . message . AisMessage12 ( ) ; msg12 . setDestination ( 219012679 ) ; msg12 . setUserId ( 219015063 ) ; msg12 . setMessage ( "TEST<sp>FROM<sp>FRV" ) ; msg12 . setSeqNum ( 1 ) ; System . out . println ( msg12 ) ; dk . dma . ais . sentence . Vdm vdm = new dk . dma . ais . sentence . Vdm ( ) ; vdm . setTalker ( "AI" ) ; vdm . setTotal ( 1 ) ; vdm . setNum ( 1 ) ; vdm . setMessageData ( msg12 ) ; vdm . setChannel ( 'A' ) ; java . lang . String encoded = vdm . getEncoded ( ) ; java . lang . String expected = "!AIVDM,1,1,,A,<3@oWUll=oTLD5CDP6B?=P6BF,0*7C" ; System . out . println ( ( "MSG<sp>12<sp>encoded<sp>:<sp>" + encoded ) ) ; System . out . println ( ( "expected:<sp>" + expected ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } dk . dma . ais . packet . AisPacketSource other = ( ( dk . dma . ais . packet . AisPacketSource ) ( obj ) ) ; if ( ( sourceBaseStation ) == null ) { if ( ( other . sourceBaseStation ) != null ) { return false ; } } else if ( ! ( sourceBaseStation . equals ( other . sourceBaseStation ) ) ) { return false ; } if ( ( sourceCountry ) == null ) { if ( ( other . sourceCountry ) != null ) { return false ; } } else if ( ! ( sourceCountry . equals ( other . sourceCountry ) ) ) { return false ; } if ( ( sourceId ) == null ) { if ( ( other . sourceId ) != null ) { return false ; } } else if ( ! ( sourceId . equals ( other . sourceId ) ) ) { return false ; } if ( ( sourceRegion ) == null ) { if ( ( other . sourceRegion ) != null ) { return false ; } } else if ( ! ( sourceRegion . equals ( other . sourceRegion ) ) ) { return false ; } if ( ( sourceType ) != ( other . sourceType ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( encoded . equals ( expected ) )
testCheckSafeMode1 ( ) { bmSafeMode . activate ( org . apache . hadoop . hdfs . server . blockmanagement . TestBlockManagerSafeMode . BLOCK_TOTAL ) ; setSafeModeStatus ( BMSafeModeStatus . PENDING_THRESHOLD ) ; for ( long i = 0 ; i < ( org . apache . hadoop . hdfs . server . blockmanagement . TestBlockManagerSafeMode . BLOCK_THRESHOLD ) ; i ++ ) { setBlockSafe ( i ) ; bmSafeMode . checkSafeMode ( ) ; "<AssertPlaceHolder>" ; } } getSafeModeStatus ( ) { return safeModeStatus ; }
org . junit . Assert . assertEquals ( BMSafeModeStatus . PENDING_THRESHOLD , getSafeModeStatus ( ) )
testLogGamma1p ( ) { final int ulps = 3 ; for ( int i = 0 ; i < ( org . apache . commons . math3 . special . GammaTest . LOG_GAMMA1P_REF . length ) ; i ++ ) { final double [ ] ref = org . apache . commons . math3 . special . GammaTest . LOG_GAMMA1P_REF [ i ] ; final double x = ref [ 0 ] ; final double expected = ref [ 1 ] ; final double actual = org . apache . commons . math3 . special . Gamma . logGamma1p ( x ) ; final double tol = ulps * ( org . apache . commons . math3 . util . FastMath . ulp ( expected ) ) ; "<AssertPlaceHolder>" ; } } toString ( java . util . List ) { java . lang . String commandString = command . toString ( ) . replace ( "[" , "" ) . replace ( "]" , "" ) . replace ( "," , "<sp>" ) ; return commandString ; }
org . junit . Assert . assertEquals ( java . lang . Double . toString ( x ) , expected , actual , tol )
shouldApplyNodeCommandToTheStoreInRecoveryMode ( ) { final org . neo4j . kernel . impl . api . BatchTransactionApplier applier = newApplier ( true ) ; final org . neo4j . kernel . impl . store . record . NodeRecord before = new org . neo4j . kernel . impl . store . record . NodeRecord ( 11 ) ; before . setLabelField ( 42 , asList ( one , two ) ) ; final org . neo4j . kernel . impl . store . record . NodeRecord after = new org . neo4j . kernel . impl . store . record . NodeRecord ( 12 ) ; after . setInUse ( true ) ; after . setLabelField ( 42 , asList ( one , two , three ) ) ; final org . neo4j . kernel . impl . transaction . command . Command . NodeCommand command = new org . neo4j . kernel . impl . transaction . command . Command . NodeCommand ( before , after ) ; boolean result = apply ( applier , command :: handle , transactionToApply ) ; "<AssertPlaceHolder>" ; verify ( lockService , times ( 1 ) ) . acquireNodeLock ( command . getKey ( ) , LockService . LockType . WRITE_LOCK ) ; verify ( nodeStore , times ( 1 ) ) . setHighestPossibleIdInUse ( after . getId ( ) ) ; verify ( nodeStore , times ( 1 ) ) . updateRecord ( after ) ; verify ( dynamicLabelStore , times ( 1 ) ) . setHighestPossibleIdInUse ( three . getId ( ) ) ; } apply ( org . neo4j . kernel . api . proc . Context , java . lang . Object [ ] , org . neo4j . kernel . api . ResourceTracker ) { try { java . lang . Thread . sleep ( 50 ) ; } catch ( java . lang . InterruptedException e ) { throw new org . neo4j . internal . kernel . api . exceptions . ProcedureException ( Status . General . UnknownError , e , "Interrupted" ) ; } return org . neo4j . collection . RawIterator . empty ( ) ; }
org . junit . Assert . assertFalse ( result )
testRestartDBInstance ( ) { try { com . fit2cloud . aliyun . rds . model . request . RestartDBInstanceRequest request = new com . fit2cloud . aliyun . rds . model . request . RestartDBInstanceRequest ( ) ; request . setDBInstanceId ( dBInstanceId ) ; com . fit2cloud . aliyun . Response response = client . restartDBInstance ( request ) ; System . out . println ( ( "testRestartDBInstance<sp>::<sp>" + ( new com . google . gson . Gson ( ) . toJson ( response ) ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } restartDBInstance ( com . fit2cloud . aliyun . rds . model . request . RestartDBInstanceRequest ) { return gson . fromJson ( request . execute ( "RestartDBInstance" , restartDBInstanceRequest . toMap ( ) ) , com . fit2cloud . aliyun . Response . class ) ; }
org . junit . Assert . assertTrue ( true )
testSetLastAllocatedCluster ( ) { System . out . println ( "setLastAllocatedCluster" ) ; final de . waldheinz . fs . fat . FsInfoSector fsi = de . waldheinz . fs . fat . FsInfoSector . create ( bs ) ; fsi . setLastAllocatedCluster ( 100 ) ; "<AssertPlaceHolder>" ; } getLastAllocatedCluster ( ) { return super . get32 ( de . waldheinz . fs . fat . FsInfoSector . LAST_ALLOCATED_OFFSET ) ; }
org . junit . Assert . assertEquals ( 100 , fsi . getLastAllocatedCluster ( ) )
configured_value_set_to_not_recognized ( ) { allowingConfigurationToReturn ( EditingObjectsConfiguration . EDIT_OBJECTS_KEY , "foobar" ) ; facetFactory . process ( new org . apache . isis . core . metamodel . facets . FacetFactory . ProcessClassContext ( org . apache . isis . core . metamodel . facets . object . domainobject . DomainObjectAnnotationFacetFactoryTest . Editing . CustomerWithDomainObjectAndEditingSetToAsConfigured . class , null , mockMethodRemover , facetHolder ) ) ; final org . apache . isis . core . metamodel . facetapi . Facet facet = facetHolder . getFacet ( org . apache . isis . core . metamodel . facets . object . immutable . ImmutableFacet . class ) ; "<AssertPlaceHolder>" ; expectNoMethodsRemoved ( ) ; } getFacet ( java . lang . Class ) { final org . apache . isis . core . metamodel . facetapi . FacetHolder facetHolder = getAction ( ) ; return facetHolder . getFacet ( facetType ) ; }
org . junit . Assert . assertNull ( facet )
compareTo_shouldReturnMinusOneIfBothLowsAreEqualButOtherHighIsLessThanThisHigh ( ) { org . openmrs . util . DoubleRange r1 = new org . openmrs . util . DoubleRange ( 1.0 , 2.0 ) ; org . openmrs . util . DoubleRange r2 = new org . openmrs . util . DoubleRange ( 1.0 , 1.0 ) ; "<AssertPlaceHolder>" ; } compareTo ( org . openmrs . ConceptSet ) { int value = org . openmrs . util . OpenmrsUtil . compareWithNullAsLowest ( concept . getRetired ( ) , cs . concept . getRetired ( ) ) ; if ( value == 0 ) { value = org . openmrs . util . OpenmrsUtil . compareWithNullAsLowest ( this . getSortWeight ( ) , cs . getSortWeight ( ) ) ; } return value ; }
org . junit . Assert . assertEquals ( ( - 1 ) , r1 . compareTo ( r2 ) )
testNegativeY ( ) { org . apache . commons . math4 . geometry . euclidean . twod . Cartesian2D c = new org . apache . commons . math4 . geometry . euclidean . twod . Cartesian2D ( 1.23 , ( - 1.434343434343 ) ) ; java . lang . String expected = ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "23;<sp>-1" ) + ( getDecimalCharacter ( ) ) ) + "4343434343}" ; java . lang . String actual = vector2DFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testDeleteNetwork_Operation ( ) { org . easymock . EasyMock . expect ( computeRpcMock . deleteNetwork ( com . google . cloud . compute . deprecated . ComputeImplTest . NETWORK_ID . getNetwork ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( globalOperation . toPb ( ) ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; "<AssertPlaceHolder>" ; } deleteNetwork ( com . google . cloud . compute . v1 . ProjectGlobalNetworkName ) { com . google . cloud . compute . v1 . DeleteNetworkHttpRequest request = com . google . cloud . compute . v1 . DeleteNetworkHttpRequest . newBuilder ( ) . setNetwork ( ( network == null ? null : network . toString ( ) ) ) . build ( ) ; return deleteNetwork ( request ) ; }
org . junit . Assert . assertEquals ( globalOperation , compute . deleteNetwork ( com . google . cloud . compute . deprecated . ComputeImplTest . NETWORK_ID ) )
shouldSerializeToStringUsingStringSerializerSpecificMethodIfSerializerIsOfSpecificInstance ( ) { org . codegist . crest . serializer . StringSerializer serializer = mock ( org . codegist . crest . serializer . StringSerializer . class ) ; when ( serializer . serialize ( "arg" , org . codegist . crest . util . UTF8 ) ) . thenReturn ( "serialized" ) ; java . lang . String actual = org . codegist . crest . util . Serializers . serialize ( serializer , "arg" , org . codegist . crest . util . UTF8 ) ; "<AssertPlaceHolder>" ; } serialize ( org . codegist . crest . serializer . Serializer , T , java . nio . charset . Charset ) { if ( serializer instanceof org . codegist . crest . serializer . StringSerializer ) { return ( ( org . codegist . crest . serializer . StringSerializer < T > ) ( serializer ) ) . serialize ( value , charset ) ; } else { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; serializer . serialize ( value , charset , out ) ; return new java . lang . String ( out . toByteArray ( ) , charset ) ; } }
org . junit . Assert . assertEquals ( "serialized" , actual )
testRpcCall ( ) { LOG . debug ( "testRpcCall" ) ; dfs1 = org . apache . hadoop . hdfs . DistributedFileSystem . newInstance ( conf ) ; boolean exists = dfs1 . exists ( new org . apache . hadoop . fs . Path ( "some_path" ) ) ; LOG . debug ( ( "Does<sp>exist?<sp>" + exists ) ) ; "<AssertPlaceHolder>" ; } debug ( java . lang . Throwable ) { if ( ( LOG ) != null ) { LOG . debug ( t ) ; } else if ( ( LOGGER ) != null ) { LOGGER . debug ( "" , t ) ; } }
org . junit . Assert . assertFalse ( exists )
getIpAddress_NIC1_undefined ( ) { java . lang . String ipAddress = propertyHandler . getIpAddress ( 1 ) ; "<AssertPlaceHolder>" ; } getIpAddress ( com . vmware . vim25 . GuestInfo ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( int i = 1 ; i <= ( paramHandler . getNumberOfNetworkAdapter ( ) ) ; i ++ ) { com . vmware . vim25 . GuestNicInfo info = getNicInfo ( guestInfo , paramHandler . getNetworkAdapter ( i ) ) ; if ( info != null ) { if ( ( ( paramHandler . getNetworkAdapter ( i ) ) != null ) && ( ! ( paramHandler . getNetworkAdapter ( i ) . trim ( ) . isEmpty ( ) ) ) ) { sb . append ( ( ( paramHandler . getNetworkAdapter ( i ) ) + ":<sp>" ) ) ; } sb . append ( info . getIpAddress ( ) ) ; if ( i < ( paramHandler . getNumberOfNetworkAdapter ( ) ) ) { sb . append ( ",<sp>" ) ; } } } return sb . toString ( ) ; }
org . junit . Assert . assertNull ( ipAddress )
NewSubnetTest ( ) { com . cloud . utils . Pair < java . lang . Boolean , com . cloud . utils . Pair < java . lang . String , java . lang . String > > sameSubnet = configurationMgr . validateIpRange ( "10.147.33.140" , "10.147.33.145" , "10.147.33.130" , "255.255.255.192" , vlanVOList , true , false , null , null , null , null , network ) ; "<AssertPlaceHolder>" ; } first ( ) { return t ; }
org . junit . Assert . assertTrue ( ( ! ( sameSubnet . first ( ) ) ) )
testGetSortingInfoPLFM_4459 ( ) { org . sagebionetworks . repo . model . table . SortItem foo = new org . sagebionetworks . repo . model . table . SortItem ( ) ; foo . setColumn ( "foo" ) ; foo . setDirection ( SortDirection . ASC ) ; java . util . List < org . sagebionetworks . repo . model . table . SortItem > expected = java . util . Arrays . asList ( foo ) ; java . util . List < org . sagebionetworks . repo . model . table . SortItem > results = org . sagebionetworks . table . query . util . TableSqlProcessor . getSortingInfo ( ( ( "select<sp>*<sp>from<sp>" + ( tableId ) ) + "<sp>order<sp>by<sp>foo" ) ) ; "<AssertPlaceHolder>" ; } getSortingInfo ( java . lang . String ) { org . sagebionetworks . table . query . model . QuerySpecification model = org . sagebionetworks . table . query . TableQueryParser . parserQuery ( sql ) ; return org . sagebionetworks . table . query . util . TableSqlProcessor . getSortingInfo ( model ) ; }
org . junit . Assert . assertEquals ( expected , results )
testIsEmpty ( ) { final int capacity = com . carrotsearch . randomizedtesting . RandomizedTest . between ( 10 , 20 ) ; final org . neo4j . graphalgo . core . utils . queue . LongMinPriorityQueue queue = new org . neo4j . graphalgo . core . utils . queue . LongMinPriorityQueue ( capacity ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( queue . size ( ) , 0 )
testAvroToDiArray ( ) { java . lang . String expectedType = "id_List" ; org . apache . avro . Schema fieldSchema = org . apache . avro . Schema . createArray ( org . apache . avro . Schema . create ( Schema . Type . STRING ) ) ; "<AssertPlaceHolder>" ; } avroToDi ( org . apache . avro . Schema ) { org . apache . avro . Schema typeSchema = org . talend . daikon . avro . AvroUtils . unwrapIfNullable ( fieldSchema ) ; java . lang . String logicalType = org . talend . daikon . avro . LogicalTypeUtils . getLogicalTypeName ( typeSchema ) ; if ( logicalType != null ) { return org . talend . codegen . converter . TypeConverter . getDiByLogicalType ( logicalType ) ; } java . lang . String javaClass = typeSchema . getProp ( SchemaConstants . JAVA_CLASS_FLAG ) ; if ( javaClass != null ) { return org . talend . codegen . converter . TypeConverter . getDiByJavaClass ( javaClass ) ; } return org . talend . codegen . converter . TypeConverter . getDiByAvroType ( typeSchema . getType ( ) ) ; }
org . junit . Assert . assertEquals ( expectedType , org . talend . codegen . converter . TypeConverter . avroToDi ( fieldSchema ) )
testValidationWithDigest ( ) { eu . europa . esig . dss . DSSDocument toBeSigned = new eu . europa . esig . dss . FileDocument ( new java . io . File ( "src/test/resources/sample.xml" ) ) ; eu . europa . esig . dss . xades . signature . XAdESService service = new eu . europa . esig . dss . xades . signature . XAdESService ( getCompleteCertificateVerifier ( ) ) ; eu . europa . esig . dss . xades . XAdESSignatureParameters params = new eu . europa . esig . dss . xades . XAdESSignatureParameters ( ) ; params . setSignatureLevel ( SignatureLevel . XAdES_BASELINE_B ) ; params . setDigestAlgorithm ( DigestAlgorithm . SHA256 ) ; params . setSignaturePackaging ( SignaturePackaging . DETACHED ) ; params . setSigningCertificate ( getSigningCert ( ) ) ; eu . europa . esig . dss . ToBeSigned dataToSign = service . getDataToSign ( toBeSigned , params ) ; eu . europa . esig . dss . SignatureValue signatureValue = getToken ( ) . sign ( dataToSign , params . getDigestAlgorithm ( ) , getPrivateKeyEntry ( ) ) ; eu . europa . esig . dss . DSSDocument signedDocument = service . signDocument ( toBeSigned , params , signatureValue ) ; eu . europa . esig . dss . validation . SignedDocumentValidator validator = eu . europa . esig . dss . validation . SignedDocumentValidator . fromDocument ( signedDocument ) ; validator . setCertificateVerifier ( getCompleteCertificateVerifier ( ) ) ; java . util . List < eu . europa . esig . dss . DSSDocument > detachedContents = new java . util . ArrayList < eu . europa . esig . dss . DSSDocument > ( ) ; eu . europa . esig . dss . DigestDocument digestDocument = new eu . europa . esig . dss . DigestDocument ( ) ; digestDocument . setName ( "sample.xml" ) ; digestDocument . addDigest ( DigestAlgorithm . SHA256 , toBeSigned . getDigest ( DigestAlgorithm . SHA256 ) ) ; detachedContents . add ( digestDocument ) ; validator . setDetachedContents ( detachedContents ) ; eu . europa . esig . dss . validation . reports . Reports reports = validator . validateDocument ( ) ; eu . europa . esig . dss . validation . reports . wrapper . DiagnosticData diagnosticData = reports . getDiagnosticData ( ) ; eu . europa . esig . dss . validation . reports . wrapper . SignatureWrapper signatureById = diagnosticData . getSignatureById ( diagnosticData . getFirstSignatureId ( ) ) ; "<AssertPlaceHolder>" ; } isBLevelTechnicallyValid ( ) { return ( ( signature . getBasicSignature ( ) ) != null ) && ( signature . getBasicSignature ( ) . isSignatureValid ( ) ) ; }
org . junit . Assert . assertTrue ( signatureById . isBLevelTechnicallyValid ( ) )
updateAnotherUserFails ( ) { "<AssertPlaceHolder>" ; final cc . kune . core . shared . dto . UserDTO user = new cc . kune . core . shared . dto . UserDTO ( "test" , "test" , "123456" , "example1234@example.com" , lang , country , timezone , null , true , cc . kune . core . shared . dto . SubscriptionMode . manual , "blue" ) ; userService . createUser ( user , false ) ; doLogin ( ) ; userService . updateUser ( getHash ( ) , user , simpleLang ) ; } getUser ( ) { return user ; }
org . junit . Assert . assertNull ( session . getUser ( ) . getId ( ) )
createLServer_CountCPUIsNull ( ) { java . util . HashMap < java . lang . String , java . lang . String > request = givenRequest ( org . oscm . app . ror . LPlatformClientTest . INSTANCENAME , org . oscm . app . ror . LPlatformClientTest . SERVERTYPE , org . oscm . app . ror . LPlatformClientTest . DISKIMAGEID , org . oscm . app . ror . LPlatformClientTest . CONTROLNETWORKID , org . oscm . app . ror . LPlatformClientTest . VMPOOL , org . oscm . app . ror . LPlatformClientTest . STORAGEPOOL , null , org . oscm . app . ror . LPlatformClientTest . LPLATFORMID ) ; PrepareXMLConfiguration ( request , org . oscm . app . ror . LPlatformClientTest . LSERVERID ) ; java . lang . String result = lPlatformClient . createLServer ( org . oscm . app . ror . LPlatformClientTest . INSTANCENAME , org . oscm . app . ror . LPlatformClientTest . SERVERTYPE , org . oscm . app . ror . LPlatformClientTest . DISKIMAGEID , org . oscm . app . ror . LPlatformClientTest . CONTROLNETWORKID , org . oscm . app . ror . LPlatformClientTest . VMPOOL , org . oscm . app . ror . LPlatformClientTest . STORAGEPOOL , null ) ; "<AssertPlaceHolder>" ; } createLServer ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { java . util . List < java . lang . String > emptyParams = new java . util . ArrayList < java . lang . String > ( ) ; if ( isEmpty ( lplatformId ) ) { emptyParams . add ( LParameter . LPLATFORM_ID ) ; } if ( isEmpty ( instanceName ) ) { emptyParams . add ( LParameter . LSERVER_NAME ) ; } if ( ! ( emptyParams . isEmpty ( ) ) ) { throw new org . oscm . app . iaas . exceptions . MissingParameterException ( org . oscm . app . ror . data . LOperation . CREATE_LSERVER , emptyParams ) ; } java . util . HashMap < java . lang . String , java . lang . String > request = this . getRequestParameters ( ) ; request . put ( LParameter . ACTION , LOperation . CREATE_LSERVER ) ; request . put ( LParameter . LSERVER_NAME , instanceName ) ; request . put ( LParameter . LSERVER_TYPE , serverType ) ; request . put ( LParameter . DISKIMAGE_ID , diskImageId ) ; request . put ( LParameter . CONTROL_NETWORK_ID , controlNetworkId ) ; if ( vmPool != null ) { request . put ( LParameter . POOL , vmPool ) ; } else { request . put ( LParameter . POOL , "VMHostPool" ) ; } if ( ( storagePool != null ) && ( ( storagePool . trim ( ) . length ( ) ) > 0 ) ) { request . put ( LParameter . STORAGE_POOL , storagePool ) ; } else { request . put ( LParameter . STORAGE_POOL , "StoragePool" ) ; } if ( countCPU != null ) { request . put ( LParameter . CPU_NUMBER , countCPU ) ; } org . apache . commons . configuration . XMLConfiguration result = vdcClient . execute ( request ) ; return result . getString ( LParameter . LSERVER_ID ) ; }
org . junit . Assert . assertEquals ( result , org . oscm . app . ror . LPlatformClientTest . LSERVERID )
testBspCombiner ( ) { org . apache . giraph . conf . GiraphConfiguration conf = new org . apache . giraph . conf . GiraphConfiguration ( ) ; conf . setComputationClass ( org . apache . giraph . examples . SimpleCombinerComputation . class ) ; conf . setVertexInputFormatClass ( org . apache . giraph . examples . SimpleSuperstepComputation . SimpleSuperstepVertexInputFormat . class ) ; conf . setMessageCombinerClass ( org . apache . giraph . combiner . SimpleSumMessageCombiner . class ) ; org . apache . giraph . job . GiraphJob job = prepareJob ( getCallingMethodName ( ) , conf ) ; "<AssertPlaceHolder>" ; } run ( boolean ) { setIntConfIfDefault ( "mapreduce.job.counters.limit" , 512 ) ; setIntConfIfDefault ( "mapred.job.map.memory.mb" , 1024 ) ; setIntConfIfDefault ( "mapred.job.reduce.memory.mb" , 0 ) ; giraphConfiguration . setBoolean ( "mapred.map.tasks.speculative.execution" , false ) ; org . apache . hadoop . ipc . Client . setPingInterval ( giraphConfiguration , ( 60000 * 5 ) ) ; giraphConfiguration . setBoolean ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 5 , true ) ; giraphConfiguration . setBoolean ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 1 , true ) ; if ( ( giraphConfiguration . getCheckpointFrequency ( ) ) == 0 ) { int oldMaxTaskAttempts = giraphConfiguration . getMaxTaskAttempts ( ) ; giraphConfiguration . setMaxTaskAttempts ( 1 ) ; if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( ( ( ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 0 + "do<sp>not<sp>allow<sp>any<sp>task<sp>retries<sp>(setting<sp>" ) + ( GiraphConstants . MAX_TASK_ATTEMPTS . getKey ( ) ) ) + "<sp>=<sp>1,<sp>" ) + "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 2 ) + oldMaxTaskAttempts ) + ")" ) ) ; } } org . apache . giraph . conf . ImmutableClassesGiraphConfiguration conf = new org . apache . giraph . conf . ImmutableClassesGiraphConfiguration ( giraphConfiguration ) ; org . apache . giraph . job . GiraphJob . checkLocalJobRunnerConfiguration ( conf ) ; int tryCount = 0 ; org . apache . giraph . job . GiraphJobRetryChecker retryChecker = conf . getJobRetryChecker ( ) ; while ( true ) { org . apache . giraph . job . GiraphJobObserver jobObserver = conf . getJobObserver ( ) ; org . apache . giraph . job . JobProgressTrackerService jobProgressTrackerService = org . apache . giraph . job . DefaultJobProgressTrackerService . createJobProgressTrackerService ( conf , jobObserver ) ; org . apache . giraph . job . ClientThriftServer clientThriftServer = null ; if ( jobProgressTrackerService != null ) { clientThriftServer = new org . apache . giraph . job . ClientThriftServer ( conf , com . google . common . collect . ImmutableList . of ( jobProgressTrackerService ) ) ; } tryCount ++ ; org . apache . hadoop . mapreduce . Job submittedJob = new org . apache . hadoop . mapreduce . Job ( conf , jobName ) ; if ( ( submittedJob . getJar ( ) ) == null ) { submittedJob . setJarByClass ( getClass ( ) ) ; } submittedJob . setNumReduceTasks ( 0 ) ; submittedJob . setMapperClass ( org . apache . giraph . graph . GraphMapper . class ) ; submittedJob . setInputFormatClass ( org . apache . giraph . bsp . BspInputFormat . class ) ; submittedJob . setOutputFormatClass ( GiraphConstants . HADOOP_OUTPUT_FORMAT_CLASS . get ( conf ) ) ; if ( jobProgressTrackerService != null ) { jobProgressTrackerService . setJob ( submittedJob ) ; } jobObserver . launchingJob ( submittedJob ) ; submittedJob . submit ( ) ; if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( "Tracking<sp>URL:<sp>" + ( submittedJob . getTrackingURL ( ) ) ) ) ; org . apache . giraph . job . GiraphJob . LOG . info ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" + ( ( conf . getMinWorkers ( ) ) + 1 ) ) + "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 3 ) ) ; } jobObserver . jobRunning ( submittedJob ) ; org . apache . giraph . job . HaltApplicationUtils . printHaltInfo ( submittedJob , conf ) ; boolean passed = submittedJob . waitForCompletion ( verbose ) ; if ( jobProgressTrackerService != null ) { jobProgressTrackerService . stop ( passed ) ; } if ( clientThriftServer != null ) { clientThriftServer . stopThriftServer ( ) ; } jobObserver . jobFinished ( submittedJob , passed ) ; if ( ! passed ) { java . lang . String restartFrom = retryChecker . shouldRestartCheckpoint ( submittedJob ) ; if ( restartFrom != null ) { GiraphConstants . RESTART_JOB_ID . set ( conf , restartFrom ) ; continue ; } } if ( passed || ( ! ( retryChecker . shouldRetry ( submittedJob , tryCount ) ) ) ) { return passed ; } if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 4 + tryCount ) + "<sp>try" ) ) ; } } }
org . junit . Assert . assertTrue ( job . run ( true ) )
testGetValue ( ) { java . nio . ByteBuffer bb = java . nio . ByteBuffer . allocate ( 8 ) ; bb . put ( 7 , ( ( byte ) ( 42 ) ) ) ; byte [ ] expResult = bb . array ( ) ; byte [ ] result = instance . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertArrayEquals ( expResult , result )
testSet_IAtomContainer_IAtomContainer ( ) { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer target = sp . parseSmiles ( "C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C" ) ; org . openscience . cdk . interfaces . IAtomContainer queryac = sp . parseSmiles ( "Nc1ccccc1" ) ; org . openscience . cdk . smsd . algorithm . mcsplus . MCSPlusHandler smsd1 = new org . openscience . cdk . smsd . algorithm . mcsplus . MCSPlusHandler ( ) ; org . openscience . cdk . smsd . tools . MolHandler mol1 = new org . openscience . cdk . smsd . tools . MolHandler ( queryac , true , true ) ; org . openscience . cdk . smsd . tools . MolHandler mol2 = new org . openscience . cdk . smsd . tools . MolHandler ( target , true , true ) ; smsd1 . set ( mol1 , mol2 ) ; smsd1 . searchMCS ( true ) ; "<AssertPlaceHolder>" ; } getFirstMapping ( ) { return firstSolution . isEmpty ( ) ? null : firstSolution ; }
org . junit . Assert . assertNotNull ( smsd1 . getFirstMapping ( ) )
testFluentInterfaceWithPort ( ) { System . out . println ( "testFluentInterfaceWithPort" ) ; int expResult = 5555 ; team . bus . model . bean . DataBaseInfo instance = new team . bus . model . bean . DataBaseInfo ( ) ; instance . withPort ( expResult ) ; int result = instance . getPort ( ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return this . port ; }
org . junit . Assert . assertEquals ( expResult , result )
shouldReturnFalseIfDeathWasNotCausedBySepsis ( ) { boolean didRuleApply = rule . apply ( new org . ei . drishti . util . SafeMap ( create ( "deathCause" , "within_24hrs" ) . map ( ) ) ) ; "<AssertPlaceHolder>" ; } map ( ) { return map ; }
org . junit . Assert . assertFalse ( didRuleApply )
testSet ( ) { net . amygdalum . xrayinterface . FieldProperty property = fieldProperty ( new net . amygdalum . xrayinterface . FieldSetter ( "field" , set ) , null ) ; property . set ( ) . invoke ( this , "valueFromSet" ) ; "<AssertPlaceHolder>" ; } invoke ( java . lang . Object , java . lang . Object [ ] ) { if ( ( args != null ) && ( ( args . length ) != 0 ) ) { throw new java . lang . IllegalArgumentException ( ( ( "getters<sp>can<sp>only<sp>be<sp>invoked<sp>with<sp>no<sp>argument,<sp>was<sp>" + ( args . length ) ) + "<sp>arguments" ) ) ; } return r ( getter . invoke ( object ) ) ; }
org . junit . Assert . assertThat ( field , org . hamcrest . Matchers . equalTo ( "valueFromSet" ) )
drawImageWithNullBackground ( ) { java . awt . Image img = new java . awt . image . BufferedImage ( 10 , 10 , java . awt . image . BufferedImage . TYPE_INT_ARGB ) ; g2 . drawImage ( img , 10 , 10 , null , null ) ; "<AssertPlaceHolder>" ; } drawImage ( java . awt . Image , int , int , java . awt . Color , java . awt . image . ImageObserver ) { if ( img == null ) { return true ; } int w = img . getWidth ( null ) ; if ( w < 0 ) { return false ; } int h = img . getHeight ( null ) ; if ( h < 0 ) { return false ; } return drawImage ( img , x , y , w , h , bgcolor , observer ) ; }
org . junit . Assert . assertTrue ( true )
testGetterDetection ( ) { net . sourceforge . pmd . lang . java . ast . ASTCompilationUnit compilationUnit = net . sourceforge . pmd . lang . java . ParserTstUtil . parseJava17 ( net . sourceforge . pmd . lang . java . metrics . testdata . GetterDetection . class ) ; compilationUnit . jjtAccept ( new net . sourceforge . pmd . lang . java . ast . JavaParserVisitorAdapter ( ) { @ net . sourceforge . pmd . lang . java . metrics . Override public java . lang . Object visit ( net . sourceforge . pmd . lang . java . ast . ASTMethodDeclaration node , java . lang . Object data ) { "<AssertPlaceHolder>" ; return data ; } } , null ) ; } get ( net . sourceforge . pmd . lang . java . ast . ASTMethodDeclaration ) { if ( node . isStatic ( ) ) { return net . sourceforge . pmd . lang . java . multifile . signature . JavaOperationSignature . Role . STATIC ; } else if ( net . sourceforge . pmd . lang . java . multifile . signature . JavaOperationSignature . Role . isGetterOrSetter ( node ) ) { return net . sourceforge . pmd . lang . java . multifile . signature . JavaOperationSignature . Role . GETTER_OR_SETTER ; } else { return net . sourceforge . pmd . lang . java . multifile . signature . JavaOperationSignature . Role . METHOD ; } }
org . junit . Assert . assertEquals ( Role . GETTER_OR_SETTER , net . sourceforge . pmd . lang . java . multifile . signature . JavaOperationSignature . Role . get ( node ) )
testTaskExecutionStatusWithFailedTaskExecution ( ) { final org . springframework . cloud . task . repository . TaskExecution taskExecution = new org . springframework . cloud . task . repository . TaskExecution ( ) ; taskExecution . setStartTime ( new java . util . Date ( ) ) ; taskExecution . setEndTime ( new java . util . Date ( ) ) ; taskExecution . setExitCode ( 123 ) ; final org . springframework . cloud . dataflow . rest . resource . TaskExecutionResource taskExecutionResource = new org . springframework . cloud . dataflow . rest . resource . TaskExecutionResource ( taskExecution ) ; "<AssertPlaceHolder>" ; } getTaskExecutionStatus ( ) { if ( ( this . startTime ) == null ) { return TaskExecutionStatus . UNKNOWN ; } if ( ( this . endTime ) == null ) { return TaskExecutionStatus . RUNNING ; } else { return ( this . exitCode ) == null ? TaskExecutionStatus . RUNNING : ( this . exitCode ) == 0 ? TaskExecutionStatus . COMPLETE : TaskExecutionStatus . ERROR ; } }
org . junit . Assert . assertEquals ( TaskExecutionStatus . ERROR , taskExecutionResource . getTaskExecutionStatus ( ) )
testGetParamValueBlank ( ) { java . lang . String paramName = "paramName1" ; java . lang . String paramValue = "" ; configuration . set ( paramName , paramValue ) ; java . lang . String result = eu . dnetlib . iis . common . WorkflowRuntimeParameters . getParamValue ( paramName , configuration ) ; "<AssertPlaceHolder>" ; } getParamValue ( java . lang . String , org . apache . hadoop . conf . Configuration ) { java . lang . String paramValue = configuration . get ( paramName ) ; if ( ( org . apache . commons . lang . StringUtils . isNotBlank ( paramValue ) ) && ( ! ( eu . dnetlib . iis . common . WorkflowRuntimeParameters . UNDEFINED_NONEMPTY_VALUE . equals ( paramValue ) ) ) ) { return paramValue ; } else { return null ; } }
org . junit . Assert . assertNull ( result )
testInvertDisparateIntervals ( ) { System . out . println ( "Disparate<sp>Intervals" ) ; java . util . Collection < com . sun . btrace . util . Interval > intervals = java . util . Arrays . asList ( new com . sun . btrace . util . Interval ( 1 , 3 ) , new com . sun . btrace . util . Interval ( 5 , 8 ) , new com . sun . btrace . util . Interval ( 11 , 12 ) ) ; java . util . List < com . sun . btrace . util . Interval > expResult = java . util . Arrays . asList ( com . sun . btrace . util . Interval . lt ( 1 ) , com . sun . btrace . util . Interval . eq ( 4 ) , new com . sun . btrace . util . Interval ( 9 , 10 ) , com . sun . btrace . util . Interval . gt ( 12 ) ) ; java . util . List < com . sun . btrace . util . Interval > result = com . sun . btrace . util . Interval . invert ( intervals ) ; "<AssertPlaceHolder>" ; } invert ( com . sun . btrace . util . Collection ) { com . sun . btrace . util . Interval remainder = new com . sun . btrace . util . Interval ( Integer . MIN_VALUE , Integer . MAX_VALUE ) ; com . sun . btrace . util . Set < com . sun . btrace . util . Interval > sorted = new com . sun . btrace . util . TreeSet ( com . sun . btrace . util . Interval . union ( intervals ) ) ; com . sun . btrace . util . List < com . sun . btrace . util . Interval > result = new com . sun . btrace . util . ArrayList ( ) ; for ( com . sun . btrace . util . Interval i : sorted ) { if ( i . isAll ( ) ) { return com . sun . btrace . util . Collections . singletonList ( com . sun . btrace . util . Interval . none ( ) ) ; } if ( ( i . a ) <= ( remainder . a ) ) { if ( ( i . b ) > ( remainder . a ) ) remainder . a = ( ( i . b ) != ( Integer . MAX_VALUE ) ) ? ( i . b ) + 1 : i . b ; } else { result . add ( new com . sun . btrace . util . Interval ( remainder . a , ( ( i . a ) - 1 ) ) ) ; if ( ( i . b ) < ( remainder . b ) ) { remainder . a = ( ( i . b ) != ( Integer . MAX_VALUE ) ) ? ( i . b ) + 1 : i . b ; } else { remainder = null ; break ; } } } if ( remainder != null ) { result . add ( remainder ) ; } return result ; }
org . junit . Assert . assertEquals ( expResult , result )
createShortCircuit ( ) { alluxio . wire . WorkerNetAddress dataSource = new alluxio . wire . WorkerNetAddress ( ) ; alluxio . client . block . stream . BlockInStream . BlockInStreamSource dataSourceType = BlockInStream . BlockInStreamSource . LOCAL ; alluxio . client . block . stream . BlockInStream stream = alluxio . client . block . stream . BlockInStream . create ( mMockContext , mInfo , dataSource , dataSourceType , mOptions ) ; "<AssertPlaceHolder>" ; } isShortCircuit ( ) { return mShortCircuit ; }
org . junit . Assert . assertTrue ( stream . isShortCircuit ( ) )
testXgtC ( ) { org . jacop . Store store = new org . jacop . Store ( ) ; int xLength = 1 ; int xSize = 4 ; org . jacop . IntVar [ ] x = getIntVars ( store , "x" , xLength , xSize ) ; java . util . Arrays . stream ( x ) . forEach ( ( i ) -> store . impose ( new org . jacop . XgtC ( i , ( ( i . min ( ) ) + ( xSize / 2 ) ) ) ) ) ; store . print ( ) ; int noOfSolutions = noOfAllSolutions ( store , x ) ; "<AssertPlaceHolder>" ; } noOfAllSolutions ( org . jacop . core . Store , org . jacop . core . IntVar [ ] [ ] ) { org . jacop . SelectChoicePoint < org . jacop . core . IntVar > select = new org . jacop . SimpleSelect < org . jacop . core . IntVar > ( java . util . Arrays . stream ( variables ) . map ( Arrays :: stream ) . flatMap ( ( i ) -> i ) . toArray ( org . jacop . core . IntVar [ ] :: new ) , new org . jacop . MostConstrainedStatic < org . jacop . core . IntVar > ( ) , new org . jacop . IndomainMin < org . jacop . core . IntVar > ( ) ) ; org . jacop . DepthFirstSearch search = new org . jacop . DepthFirstSearch < org . jacop . core . IntVar > ( ) ; search . getSolutionListener ( ) . searchAll ( true ) ; search . getSolutionListener ( ) . recordSolutions ( true ) ; search . setAssignSolution ( true ) ; boolean result = search . labeling ( store , select ) ; return search . getSolutionListener ( ) . solutionsNo ( ) ; }
org . junit . Assert . assertThat ( noOfSolutions , org . hamcrest . CoreMatchers . is ( 16 ) )
testConcretizeWithCleanup ( ) { com . anjlab . sat3 . ICompactTripletsStructure s1 = ( ( com . anjlab . sat3 . ICompactTripletsStructure ) ( com . anjlab . sat3 . Helper . createFormula ( new int [ ] { 1 , 2 , 3 , - 1 , 2 , - 3 , 2 , - 3 , 4 , 2 , 3 , - 4 , 3 , - 4 , 5 } ) ) ) ; com . anjlab . sat3 . Helper . prettyPrint ( s1 ) ; s1 . concretize ( 2 , Value . AllNegative ) ; com . anjlab . sat3 . Helper . prettyPrint ( s1 ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( tiers . size ( ) ) == 0 ; }
org . junit . Assert . assertTrue ( s1 . isEmpty ( ) )
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . asset . model . AssetEntryUsage > assetEntryUsages = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( assetEntryUsages . isEmpty ( ) )
shouldImportManyToMany ( ) { net . rrm . ehour . backup . service . restore . UserDepartment department = net . rrm . ehour . backup . service . restore . UserDepartmentObjectMother . createUserDepartment ( ) ; net . rrm . ehour . backup . service . restore . EntityParser parser = createParser ( "<USERLIST>\n<sp><USERS>\n<sp><USER_ID>1</USER_ID>\n<sp><USERNAME>admin</USERNAME>\n<sp><PASSWORD>1d798ca9dba7df61bf399a02695f9f50034bad66</PASSWORD>\n<sp><FIRST_NAME>eHour</FIRST_NAME>\n<sp><LAST_NAME>Admin</LAST_NAME>\n<sp><EMAIL>t@t.net</EMAIL>\n<sp><ACTIVE>Y</ACTIVE>\n<sp></USERS>\n<sp><USERS>\n<sp><USER_ID>3</USER_ID>\n<sp><USERNAME>thies</USERNAME>\n<sp><PASSWORD>e2e90187007d55ae40678e11e0c9581cb7bb9928</PASSWORD>\n<sp><FIRST_NAME>Thies</FIRST_NAME>\n<sp><LAST_NAME>Edeling</LAST_NAME>\n<sp><EMAIL>thies@te-con.nl</EMAIL>\n<sp><ACTIVE>Y</ACTIVE>\n<sp><SALT>6367</SALT>\n<sp></USERS>\n<sp></USERLIST>\n" , department , 1 ) ; net . rrm . ehour . backup . service . restore . JoinTables joinTables = new net . rrm . ehour . backup . service . restore . JoinTables ( ) ; joinTables . put ( "USER_TO_DEPARTMENT" , "1" , "2" ) ; joinTables . put ( "USER_TO_USERROLE" , "1" , "ADMIN" ) ; java . util . List < net . rrm . ehour . backup . service . restore . User > result = parser . parse ( net . rrm . ehour . backup . service . restore . User . class , joinTables , status ) ; net . rrm . ehour . backup . service . restore . User user = result . get ( 0 ) ; "<AssertPlaceHolder>" ; } getUserRoles ( ) { return com . google . common . collect . Lists . newArrayList ( UserRole . ROLES . values ( ) ) ; }
org . junit . Assert . assertEquals ( 1 , user . getUserRoles ( ) . size ( ) )
testGetUser ( ) { classUnderTest . setUser ( "aTestString" ) ; "<AssertPlaceHolder>" ; } getUser ( ) { return user ; }
org . junit . Assert . assertEquals ( "aTestString" , classUnderTest . getUser ( ) )
getDirectPropertiesOnRegistryExample ( ) { me . tomassetti . turin . resolvers . SymbolResolver resolver = new me . tomassetti . turin . resolvers . InFileSymbolResolver ( me . tomassetti . turin . resolvers . jdk . JdkTypeResolver . getInstance ( ) ) ; me . tomassetti . turin . parser . ast . typeusage . TurinFile turinFile = me . tomassetti . turin . compiler . ExamplesAst . registryAst ( ) ; me . tomassetti . turin . parser . ast . typeusage . TurinTypeDefinition person = turinFile . getTopTypeDefinition ( "Person" ) . get ( ) ; "<AssertPlaceHolder>" ; } getDirectProperties ( me . tomassetti . turin . resolvers . SymbolResolver ) { me . tomassetti . turin . parser . ast . List < me . tomassetti . turin . parser . ast . Property > properties = new me . tomassetti . turin . parser . ast . ArrayList ( ) ; for ( me . tomassetti . turin . parser . ast . Node member : members ) { if ( member instanceof me . tomassetti . turin . parser . ast . properties . PropertyDefinition ) { properties . add ( me . tomassetti . turin . parser . ast . Property . fromDefinition ( ( ( me . tomassetti . turin . parser . ast . properties . PropertyDefinition ) ( member ) ) ) ) ; } else if ( member instanceof me . tomassetti . turin . parser . ast . properties . PropertyReference ) { properties . add ( me . tomassetti . turin . parser . ast . Property . fromReference ( ( ( me . tomassetti . turin . parser . ast . properties . PropertyReference ) ( member ) ) , resolver ) ) ; } } return properties ; }
org . junit . Assert . assertEquals ( 2 , person . getDirectProperties ( resolver ) . size ( ) )
testMultiple ( ) { edu . ucla . sspace . util . WorkQueue w = new edu . ucla . sspace . util . WorkQueue ( 4 ) ; final edu . ucla . sspace . util . AtomicInteger j = new edu . ucla . sspace . util . AtomicInteger ( ) ; java . util . Collection < java . lang . Runnable > c = new java . util . ArrayList < java . lang . Runnable > ( ) ; for ( int i = 0 ; i < 100 ; ++ i ) c . add ( new java . lang . Runnable ( ) { public void run ( ) { j . incrementAndGet ( ) ; } } ) ; w . run ( c ) ; "<AssertPlaceHolder>" ; } run ( java . lang . String [ ] ) { if ( ( args . length ) == 0 ) { usage ( ) ; java . lang . System . exit ( 1 ) ; } argOptions . parseOptions ( args ) ; if ( ( argOptions . numPositionalArgs ( ) ) == 0 ) { throw new java . lang . IllegalArgumentException ( "threads" 3 ) ; } outputDir = new java . io . File ( argOptions . getPositionalArg ( 0 ) ) ; if ( ! ( outputDir . isDirectory ( ) ) ) { throw new java . lang . IllegalArgumentException ( ( "threads" 2 + ( outputDir ) ) ) ; } if ( ! ( argOptions . hasOption ( "docFile" 4 ) ) ) { throw new java . lang . IllegalArgumentException ( "docFile" 8 ) ; } java . lang . String timespanStr = argOptions . getStringOption ( "docFile" 4 ) ; edu . ucla . sspace . util . TimeSpan timeSpan = new edu . ucla . sspace . util . TimeSpan ( timespanStr ) ; if ( ( argOptions . hasOption ( 'v' ) ) || ( argOptions . hasOption ( "overwrite" 2 ) ) ) { java . util . logging . Logger appRooLogger = java . util . logging . Logger . getLogger ( "edu.ucla.sspace" ) ; java . util . logging . Handler verboseHandler = new java . util . logging . ConsoleHandler ( ) ; verboseHandler . setLevel ( Level . FINE ) ; appRooLogger . addHandler ( verboseHandler ) ; appRooLogger . setLevel ( Level . FINE ) ; appRooLogger . setUseParentHandlers ( false ) ; } java . util . Iterator < edu . ucla . sspace . text . TemporalDocument > docIter = null ; java . lang . String fileList = ( argOptions . hasOption ( "docFile" 9 ) ) ? argOptions . getStringOption ( "docFile" 9 ) : null ; java . lang . String docFile = ( argOptions . hasOption ( "docFile" ) ) ? argOptions . getStringOption ( "docFile" ) : null ; if ( ( fileList == null ) && ( docFile == null ) ) { throw new java . lang . Error ( "threads" 9 ) ; } java . util . Collection < java . util . Iterator < edu . ucla . sspace . text . TemporalDocument > > docIters = new java . util . LinkedList < java . util . Iterator < edu . ucla . sspace . text . TemporalDocument > > ( ) ; if ( fileList != null ) { java . lang . String [ ] fileNames = fileList . split ( "overwrite" 4 ) ; for ( java . lang . String s : fileNames ) { docIters . add ( new edu . ucla . sspace . text . FileListTemporalDocumentIterator ( s ) ) ; } } if ( docFile != null ) { java . lang . String [ ] fileNames = docFile . split ( "overwrite" 4 ) ; for ( java . lang . String s : fileNames ) { docIters . add ( new edu . ucla . sspace . text . OneLinePerTemporalDocumentIterator ( s ) ) ; } } docIter = new edu . ucla . sspace . util . CombinedIterator < edu . ucla . sspace . text . TemporalDocument > ( docIters ) ; int numThreads = java . lang . Runtime . getRuntime ( ) . availableProcessors ( ) ; if ( argOptions . hasOption ( "threads" ) ) { numThreads = argOptions . getIntOption ( "threads" ) ; } overwrite = true ; if ( argOptions . hasOption ( "overwrite" ) ) { overwrite = argOptions . getBooleanOption ( "overwrite" ) ; } if ( argOptions . hasOption ( "interestingTokenList" ) ) { java . lang . String fileName = argOptions . getStringOption ( "interestingTokenList" ) ; java . io . BufferedReader br = new java . io . BufferedReader ( new java . io . FileReader ( fileName ) ) ; for ( java . lang . String line = null ; ( line = br . readLine ( ) ) != null ; ) { for ( java . lang . String s : line . split ( "threads" 6 ) ) { interestingWords . add ( s ) ; wordToTemporalSemantics . put ( s , new java . util . TreeMap < java . lang . Long , double [ ] > ( ) ) ; } } edu . ucla . sspace . mains . FixedDurationTemporalRandomIndexingMain . LOGGER . info ( ( ( "threads" 7 + ( interestingWords . size ( ) ) ) + "threads" 5 ) ) ; } if ( argOptions . hasOption ( "overwrite" 3 ) ) savePartitions = true ; if ( argOptions . hasOption ( "printShiftRankings" ) ) printShiftRankings = true ; else if ( interestingWords . isEmpty ( ) ) { throw new java . lang . IllegalArgumentException ( ( "docFile" 3 + ( "docFile" 6 + "files<sp>to<sp>disk" ) ) ) ; } if ( argOptions . hasOption
org . junit . Assert . assertEquals ( 100 , j . get ( ) )
testMyExtension ( ) { try ( org . neo4j . harness . ServerControls server = getServerBuilder ( ) . withExtension ( "/myExtension" , org . neo4j . harness . enterprise . doc . ExtensionTestingDocIT . MyUnmanagedExtension . class ) . newServer ( ) ) { org . neo4j . doc . server . HTTP . Response response = org . neo4j . doc . server . HTTP . GET ( org . neo4j . doc . server . HTTP . GET ( server . httpURI ( ) . resolve ( "myExtension" ) . toString ( ) ) . location ( ) ) ; "<AssertPlaceHolder>" ; } } status ( ) { return response . getStatus ( ) ; }
org . junit . Assert . assertEquals ( 200 , response . status ( ) )
testGetGroupCountWithDDR ( ) { this . config . setSampleRate ( ( ( LogicSnifferAcquisitionTask . CLOCK ) + 1 ) ) ; "<AssertPlaceHolder>" ; } getGroupCount ( ) { int cnt = java . lang . Math . max ( org . sump . device . logicsniffer . LogicSnifferConfig . MIN_CHANNEL_GROUPS , ( ( getChannelCount ( ) ) / ( Ols . CHANNELS_PER_BLOCK ) ) ) ; if ( isDoubleDataRateEnabled ( ) ) { cnt = java . lang . Math . min ( org . sump . device . logicsniffer . LogicSnifferConfig . MAX_CHANNEL_GROUPS_DDR , cnt ) ; } return cnt ; }
org . junit . Assert . assertEquals ( 2 , this . config . getGroupCount ( ) )
testUnalignedPeriods ( ) { java . text . NumberFormat formatDec2 = new java . text . DecimalFormat ( "0.00" ) ; java . text . NumberFormat formatDec6 = new java . text . DecimalFormat ( "0.000000" ) ; net . finmath . time . TimeDiscretization liborPeriodDiscretization = liborMarketModel . getLiborPeriodDiscretization ( ) ; for ( int iPeriodStart = ( liborPeriodDiscretization . getNumberOfTimeSteps ( ) ) - 2 ; iPeriodStart < ( ( liborPeriodDiscretization . getNumberOfTimeSteps ( ) ) - 1 ) ; iPeriodStart ++ ) { double periodStart = liborPeriodDiscretization . getTime ( 3 ) ; double periodEnd = liborPeriodDiscretization . getTime ( ( iPeriodStart + 1 ) ) ; double periodLength = periodEnd - periodStart ; periodStart += ( liborPeriodDiscretization . getTime ( 4 ) ) - ( liborPeriodDiscretization . getTime ( 3 ) ) ; periodEnd += ( liborPeriodDiscretization . getTime ( 4 ) ) - ( liborPeriodDiscretization . getTime ( 3 ) ) ; net . finmath . montecarlo . interestrate . products . indices . AbstractIndex index = new net . finmath . montecarlo . interestrate . products . indices . LIBORIndex ( 0.0 , periodLength ) ; net . finmath . montecarlo . interestrate . products . components . Period period = new net . finmath . montecarlo . interestrate . products . components . Period ( periodStart , periodEnd , periodStart , periodEnd , new net . finmath . montecarlo . interestrate . products . components . Notional ( 1.0 ) , index , periodLength , true , true , false ) ; double value = period . getValue ( liborMarketModel ) ; final double oneBasisPoint = ( 1.0 / 100.0 ) / 100.0 ; double toleranceThisTest = oneBasisPoint / ( java . lang . Math . sqrt ( ( ( liborMarketModel . getNumberOfPaths ( ) ) / 200000.0 ) ) ) ; "<AssertPlaceHolder>" ; System . out . println ( ( ( ( ( ( ( formatDec2 . format ( periodStart ) ) + "\t" ) + ( formatDec2 . format ( periodEnd ) ) ) + "\t" ) + ( formatDec6 . format ( value ) ) ) + "\t" ) ) ; } System . out . println ( ) ; } getNumberOfPaths ( ) { return stochasticDriver . getNumberOfPaths ( ) ; }
org . junit . Assert . assertEquals ( 0.0 , ( value / periodLength ) , toleranceThisTest )
withOldIfModifiedTest ( ) { final java . lang . String uri = "http://www.tf1.fr/xml/rss/0,,10,00.xml" ; final net . violet . platform . httpclient . ConnectionsManager manager = new net . violet . platform . httpclient . ConnectionsManager ( 1 ) ; final net . violet . platform . httpclient . ConnectionConfiguration configuration = new net . violet . platform . httpclient . ConnectionConfiguration ( uri ) ; configuration . addLastModified ( new java . util . Date ( ( ( java . lang . System . currentTimeMillis ( ) ) - ( ( 365 * 24 ) * 3600000 ) ) ) ) ; final net . violet . platform . httpclient . Connection connection = manager . openConnection ( configuration ) ; final byte [ ] content = org . apache . commons . io . IOUtils . toByteArray ( connection . getInputStream ( ) ) ; "<AssertPlaceHolder>" ; manager . shutdown ( ) ; } getInputStream ( ) { final java . lang . String encoding = getHeaderValue ( "Content-Encoding" ) ; final java . io . InputStream responseAsStream = this . method . getResponseBodyAsStream ( ) ; if ( ( encoding != null ) && ( encoding . equalsIgnoreCase ( "gzip" ) ) ) { return new java . util . zip . GZIPInputStream ( responseAsStream ) ; } else if ( ( encoding != null ) && ( encoding . equalsIgnoreCase ( "deflate" ) ) ) { return new java . util . zip . InflaterInputStream ( responseAsStream , new java . util . zip . Inflater ( true ) ) ; } else { return responseAsStream ; } }
org . junit . Assert . assertTrue ( ( ( content . length ) > 0 ) )
testAccept ( ) { com . thoughtworks . qdox . model . expression . ExpressionVisitor visitor = mock ( com . thoughtworks . qdox . model . expression . ExpressionVisitor . class ) ; com . thoughtworks . qdox . model . expression . ShiftRight expr = new com . thoughtworks . qdox . model . expression . ShiftRight ( null , null ) ; java . lang . Object visitResult = new java . lang . Object ( ) ; when ( visitor . visit ( expr ) ) . thenReturn ( visitResult ) ; "<AssertPlaceHolder>" ; } accept ( com . thoughtworks . qdox . model . expression . ExpressionVisitor ) { return visitor . visit ( this ) ; }
org . junit . Assert . assertSame ( expr . accept ( visitor ) , visitResult )
testSetCharacteristicKeepsNotes ( ) { org . drugis . addis . entities . Study study = new org . drugis . addis . entities . Study ( "X" , new org . drugis . addis . entities . Indication ( 0L , "" ) ) ; study . setCharacteristic ( BasicStudyCharacteristic . TITLE , null ) ; org . drugis . addis . entities . Note note = new org . drugis . addis . entities . Note ( Source . MANUAL , "My<sp>text" ) ; study . getCharacteristicWithNotes ( BasicStudyCharacteristic . TITLE ) . getNotes ( ) . add ( note ) ; study . setCharacteristic ( BasicStudyCharacteristic . TITLE , "My<sp>title" ) ; "<AssertPlaceHolder>" ; } getCharacteristicWithNotes ( org . drugis . addis . entities . Characteristic ) { return d_chars . get ( c ) ; }
org . junit . Assert . assertEquals ( java . util . Collections . singletonList ( note ) , study . getCharacteristicWithNotes ( BasicStudyCharacteristic . TITLE ) . getNotes ( ) )
testGetRNG ( ) { java . lang . String actual = table . getRNG ( ) ; java . lang . String expected = "rng" ; "<AssertPlaceHolder>" ; } getRNG ( ) { return "rng" ; }
org . junit . Assert . assertEquals ( expected , actual )
testCollect ( ) { doReturn ( false ) . when ( futures ) . isEmpty ( ) ; doReturn ( future ) . when ( underTest ) . doCollectEmpty ( collector ) ; doReturn ( future ) . when ( underTest ) . doCollect ( futures , collector ) ; "<AssertPlaceHolder>" ; final org . mockito . InOrder order = inOrder ( futures , underTest ) ; order . verify ( futures ) . isEmpty ( ) ; order . verify ( underTest , never ( ) ) . doCollectEmpty ( collector ) ; order . verify ( underTest ) . doCollect ( futures , collector ) ; } collect ( java . util . Collection , java . util . function . Function ) { if ( stages . isEmpty ( ) ) { return doCollectEmpty ( collector ) ; } return doCollect ( stages , collector ) ; }
org . junit . Assert . assertEquals ( future , underTest . collect ( futures , collector ) )
testFirmwareIsSuitableForThingWithSameModelAndVendor ( ) { org . eclipse . smarthome . core . thing . binding . firmware . Firmware firmware = org . eclipse . smarthome . core . thing . binding . firmware . FirmwareBuilder . create ( new org . eclipse . smarthome . core . thing . ThingTypeUID ( "binding:thingTypeA" ) , "version" ) . withVendor ( "bindingVendor" ) . build ( ) ; org . eclipse . smarthome . core . thing . Thing thing = org . eclipse . smarthome . core . thing . binding . builder . ThingBuilder . create ( new org . eclipse . smarthome . core . thing . ThingTypeUID ( "binding:thingTypeA" ) , "thing" ) . build ( ) ; "<AssertPlaceHolder>" ; } isSuitableFor ( org . eclipse . smarthome . core . thing . Thing ) { return ( ( ( hasSameThingType ( thing ) ) && ( hasRequiredModel ( thing ) ) ) && ( firmwareOnThingIsHighEnough ( thing ) ) ) && ( firmwareRestriction . apply ( thing ) ) ; }
org . junit . Assert . assertThat ( firmware . isSuitableFor ( thing ) , org . hamcrest . CoreMatchers . is ( true ) )
testGetRoleFromConstructor ( ) { this . roleAssignment = new edu . harvard . iq . dataverse . RoleAssignment ( this . dataverseRole , this . roleAssignee , this . dataset , this . privateUrlToken ) ; "<AssertPlaceHolder>" ; } getRole ( ) { return role ; }
org . junit . Assert . assertEquals ( this . dataverseRole , this . roleAssignment . getRole ( ) )
testPredict ( ) { logger . info ( "testPredict" ) ; com . datumbox . framework . common . Configuration configuration = getConfiguration ( ) ; com . datumbox . framework . core . common . dataobjects . Dataframe [ ] data = com . datumbox . framework . core . Datasets . winesOrdinal ( configuration ) ; com . datumbox . framework . core . common . dataobjects . Dataframe trainingData = data [ 0 ] ; com . datumbox . framework . core . common . dataobjects . Dataframe validationData = data [ 1 ] ; java . lang . String storageName = this . getClass ( ) . getSimpleName ( ) ; com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler . TrainingParameters nsParams = new com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler . TrainingParameters ( ) ; com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler numericalScaler = com . datumbox . framework . core . machinelearning . MLBuilder . create ( nsParams , configuration ) ; numericalScaler . fit_transform ( trainingData ) ; numericalScaler . save ( storageName ) ; com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder . TrainingParameters ceParams = new com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder . TrainingParameters ( ) ; com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder categoricalEncoder = com . datumbox . framework . core . machinelearning . MLBuilder . create ( ceParams , configuration ) ; categoricalEncoder . fit_transform ( trainingData ) ; categoricalEncoder . save ( storageName ) ; java . lang . String datasetName = "winesOrdinal" ; trainingData . save ( datasetName ) ; trainingData . close ( ) ; com . datumbox . framework . core . machinelearning . classification . OrdinalRegression . TrainingParameters param = new com . datumbox . framework . core . machinelearning . classification . OrdinalRegression . TrainingParameters ( ) ; param . setTotalIterations ( 100 ) ; param . setL2 ( 0.001 ) ; com . datumbox . framework . core . machinelearning . classification . OrdinalRegression instance = com . datumbox . framework . core . machinelearning . MLBuilder . create ( param , configuration ) ; trainingData = Dataframe . Builder . load ( datasetName , configuration ) ; instance . fit ( trainingData ) ; instance . save ( storageName ) ; trainingData . delete ( ) ; instance . close ( ) ; numericalScaler . close ( ) ; categoricalEncoder . close ( ) ; numericalScaler = com . datumbox . framework . core . machinelearning . MLBuilder . load ( com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler . class , storageName , configuration ) ; categoricalEncoder = com . datumbox . framework . core . machinelearning . MLBuilder . load ( com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder . class , storageName , configuration ) ; instance = com . datumbox . framework . core . machinelearning . MLBuilder . load ( com . datumbox . framework . core . machinelearning . classification . OrdinalRegression . class , storageName , configuration ) ; numericalScaler . transform ( validationData ) ; categoricalEncoder . transform ( validationData ) ; instance . predict ( validationData ) ; java . util . Map < java . lang . Integer , java . lang . Object > expResult = new java . util . HashMap ( ) ; java . util . Map < java . lang . Integer , java . lang . Object > result = new java . util . HashMap ( ) ; for ( Map . Entry < java . lang . Integer , com . datumbox . framework . core . common . dataobjects . Record > e : validationData . entries ( ) ) { java . lang . Integer rId = e . getKey ( ) ; com . datumbox . framework . core . common . dataobjects . Record r = e . getValue ( ) ; expResult . put ( rId , r . getY ( ) ) ; result . put ( rId , r . getYPredicted ( ) ) ; } "<AssertPlaceHolder>" ; numericalScaler . delete ( ) ; categoricalEncoder . delete ( ) ; instance . delete ( ) ; validationData . close ( ) ; } getYPredicted ( ) { return yPredicted ; }
org . junit . Assert . assertEquals ( expResult , result )
testSimple ( ) { io . cdap . cdap . security . spi . authorization . Authorizer authorizer = get ( ) ; verifyAuthFailure ( namespace , user , Action . READ ) ; authorizer . grant ( io . cdap . cdap . proto . security . Authorizable . fromEntityId ( namespace ) , user , java . util . Collections . singleton ( Action . READ ) ) ; authorizer . enforce ( namespace , user , Action . READ ) ; java . util . Set < io . cdap . cdap . proto . security . Privilege > expectedPrivileges = new java . util . HashSet ( ) ; expectedPrivileges . add ( new io . cdap . cdap . proto . security . Privilege ( namespace , io . cdap . cdap . proto . security . Action . READ ) ) ; "<AssertPlaceHolder>" ; authorizer . revoke ( io . cdap . cdap . proto . security . Authorizable . fromEntityId ( namespace ) , user , java . util . Collections . singleton ( Action . READ ) ) ; verifyAuthFailure ( namespace , user , Action . READ ) ; } listPrivileges ( io . cdap . cdap . proto . security . Principal ) { return java . util . Collections . emptySet ( ) ; }
org . junit . Assert . assertEquals ( expectedPrivileges , authorizer . listPrivileges ( user ) )
testGetControl ( ) { "<AssertPlaceHolder>" ; } getControl ( ) { return composite ; }
org . junit . Assert . assertSame ( shell , component . getControl ( ) )
testFixedDateOk ( ) { int time = org . apache . shindig . gadgets . http . DefaultRequestPipelineTest . roundToSeconds ( HttpResponseTest . timeSource . currentTimeMillis ( ) ) ; org . apache . shindig . gadgets . http . HttpResponse response = new org . apache . shindig . gadgets . http . HttpResponseBuilder ( ) . addHeader ( "Date" , org . apache . shindig . common . util . DateUtil . formatRfc1123Date ( ( ( ( 1000L * time ) + 1000 ) - ( DefaultRequestPipeline . DEFAULT_DRIFT_LIMIT_MS ) ) ) ) . setCacheTtl ( 100 ) . create ( ) ; org . apache . shindig . gadgets . http . HttpResponse newResponse = org . apache . shindig . gadgets . http . DefaultRequestPipeline . maybeFixDriftTime ( response ) ; "<AssertPlaceHolder>" ; } maybeFixDriftTime ( org . apache . shindig . gadgets . http . HttpResponse ) { java . util . Collection < java . lang . String > dates = response . getHeaders ( "Date" ) ; if ( ! ( dates . isEmpty ( ) ) ) { java . util . Date d = org . apache . shindig . common . util . DateUtil . parseRfc1123Date ( dates . iterator ( ) . next ( ) ) ; if ( d != null ) { long timestamp = d . getTime ( ) ; long currentTime = org . apache . shindig . common . servlet . HttpUtil . getTimeSource ( ) . currentTimeMillis ( ) ; if ( ( java . lang . Math . abs ( ( currentTime - timestamp ) ) ) > ( org . apache . shindig . gadgets . http . DefaultRequestPipeline . responseDateDriftLimit ) ) { org . apache . shindig . gadgets . http . HttpResponseBuilder builder = new org . apache . shindig . gadgets . http . HttpResponseBuilder ( response ) ; builder . setHeader ( "Date" , org . apache . shindig . common . util . DateUtil . formatRfc1123Date ( currentTime ) ) ; response = builder . create ( ) ; } } } return response ; }
org . junit . Assert . assertSame ( response , newResponse )
testHostFQDN ( ) { org . powermock . api . mockito . PowerMockito . when ( myAddress . getHostName ( ) ) . thenReturn ( me . moocar . logbackgelf . InternetUtilsTest . RESULT_HOSTNAME ) ; org . powermock . api . mockito . PowerMockito . when ( myAddress . getCanonicalHostName ( ) ) . thenReturn ( me . moocar . logbackgelf . InternetUtilsTest . RESULT_FQDN ) ; "<AssertPlaceHolder>" ; } getLocalHostName ( ) { try { final java . lang . String canonicalHostName = java . net . InetAddress . getLocalHost ( ) . getCanonicalHostName ( ) ; if ( me . moocar . logbackgelf . InternetUtils . isFQDN ( canonicalHostName ) ) { return canonicalHostName ; } else { return java . net . InetAddress . getLocalHost ( ) . getHostName ( ) ; } } catch ( java . net . UnknownHostException e ) { java . net . NetworkInterface networkInterface = java . net . NetworkInterface . getNetworkInterfaces ( ) . nextElement ( ) ; if ( networkInterface == null ) throw e ; java . net . InetAddress ipAddress = networkInterface . getInetAddresses ( ) . nextElement ( ) ; if ( ipAddress == null ) throw e ; return ipAddress . getHostAddress ( ) ; } }
org . junit . Assert . assertEquals ( me . moocar . logbackgelf . InternetUtilsTest . RESULT_FQDN , me . moocar . logbackgelf . InternetUtils . getLocalHostName ( ) )
replaceAllMustAcceptNull ( ) { de . blizzy . documentr . util . Replacement replacement = new de . blizzy . documentr . util . Replacement ( "[0-9]" , "_" ) ; "<AssertPlaceHolder>" ; } replaceAll ( java . lang . String ) { java . lang . String result ; if ( s != null ) { result = pattern . matcher ( s ) . replaceAll ( replaceWith ) ; } else { result = null ; } return result ; }
org . junit . Assert . assertNull ( replacement . replaceAll ( null ) )
testDoSetMetadata ( ) { java . util . List < org . pentaho . platform . api . repository2 . unified . webservices . StringKeyStringValueDto > metadata = mock ( java . util . List . class ) ; doNothing ( ) . when ( fileResource . fileService ) . doSetMetadata ( org . pentaho . platform . web . http . api . resources . FileResourceTest . PATH_ID , metadata ) ; javax . ws . rs . core . Response mockResponse = mock ( javax . ws . rs . core . Response . class ) ; doReturn ( mockResponse ) . when ( fileResource ) . buildOkResponse ( ) ; javax . ws . rs . core . Response testResponse = fileResource . doSetMetadata ( org . pentaho . platform . web . http . api . resources . FileResourceTest . PATH_ID , metadata ) ; "<AssertPlaceHolder>" ; verify ( fileResource . fileService , times ( 1 ) ) . doSetMetadata ( org . pentaho . platform . web . http . api . resources . FileResourceTest . PATH_ID , metadata ) ; verify ( fileResource , times ( 1 ) ) . buildOkResponse ( ) ; } doSetMetadata ( java . lang . String , java . util . List ) { org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileDto file = getRepoWs ( ) . getFile ( idToPath ( pathId ) ) ; org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileAclDto fileAcl = getRepoWs ( ) . getAcl ( file . getId ( ) ) ; boolean canManage = ( getSession ( ) . getName ( ) . equals ( fileAcl . getOwner ( ) ) ) || ( ( ( getPolicy ( ) . isAllowed ( RepositoryReadAction . NAME ) ) && ( getPolicy ( ) . isAllowed ( RepositoryCreateAction . NAME ) ) ) && ( getPolicy ( ) . isAllowed ( AdministerSecurityAction . NAME ) ) ) ; if ( ! canManage ) { if ( fileAcl . isEntriesInheriting ( ) ) { java . util . List < org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileAclAceDto > aces = getRepoWs ( ) . getEffectiveAces ( file . getId ( ) ) ; fileAcl . setAces ( aces , fileAcl . isEntriesInheriting ( ) ) ; } for ( int i = 0 ; i < ( fileAcl . getAces ( ) . size ( ) ) ; i ++ ) { org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileAclAceDto acl = fileAcl . getAces ( ) . get ( i ) ; if ( acl . getRecipient ( ) . equals ( getSession ( ) . getName ( ) ) ) { if ( ( acl . getPermissions ( ) . contains ( RepositoryFilePermission . ACL_MANAGEMENT . ordinal ( ) ) ) || ( acl . getPermissions ( ) . contains ( RepositoryFilePermission . ALL . ordinal ( ) ) ) ) { canManage = true ; break ; } } } } if ( canManage ) { java . util . Map < java . lang . String , java . io . Serializable > fileMetadata = getRepository ( ) . getFileMetadata ( file . getId ( ) ) ; boolean isHidden = org . pentaho . platform . api . repository2 . unified . RepositoryFile . HIDDEN_BY_DEFAULT ; boolean isSchedulable = org . pentaho . platform . api . repository2 . unified . RepositoryFile . SCHEDULABLE_BY_DEFAULT ; fileMetadata . remove ( RepositoryFile . HIDDEN_KEY ) ; for ( org . pentaho . platform . api . repository2 . unified . webservices . StringKeyStringValueDto nv : metadata ) { java . lang . String key = nv . getKey ( ) ; if ( RepositoryFile . HIDDEN_KEY . equalsIgnoreCase ( key ) ) { isHidden = org . apache . commons . lang . BooleanUtils . toBoolean ( nv . getValue ( ) ) ; continue ; } if ( RepositoryFile . SCHEDULABLE_KEY . equalsIgnoreCase ( key ) ) { isSchedulable = org . apache . commons . lang . BooleanUtils . toBoolean ( nv . getValue ( ) ) ; } fileMetadata . put ( key , nv . getValue ( ) ) ; } if ( ! ( file . isFolder ( ) ) ) { getRepository ( ) . setFileMetadata ( file . getId ( ) , fileMetadata ) ; } if ( ( file . isHidden ( ) ) != isHidden ) { file . setHidden ( isHidden ) ; file . setNotSchedulable ( ( ! isSchedulable ) ) ; org . pentaho . platform . api . repository2 . unified . RepositoryFile sourceFile = getRepository ( ) . getFileById ( file . getId ( ) ) ; org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileDto destFileDto = toFileDto ( sourceFile , null , false ) ; destFileDto . setHidden ( isHidden ) ; destFileDto . setNotSchedulable ( ( ! isSchedulable ) ) ; org . pentaho . platform . api . repository2 . unified . RepositoryFile destFile = toFile ( destFileDto ) ; org . pentaho . platform . api . repository2 . unified . RepositoryFileAcl acl = getRepository ( ) . getAcl ( sourceFile . getId ( ) ) ; if ( ! ( file . isFolder ( ) ) ) { org . pentaho . platform . api . repository2 . unified . IRepositoryFileData data = org . pentaho . platform . web . http . api . resources . utils . RepositoryFileHelper . getFileData ( sourceFile ) ; getRepository ( ) . updateFile ( destFile , data , null ) ; getRepository ( ) . updateAcl ( acl ) ; } else { getRepository ( ) . updateFolder ( destFile , null ) ; } } }
org . junit . Assert . assertEquals ( mockResponse , testResponse )
collectKeyMultiValues ( ) { org . eclipse . collections . api . multimap . Multimap < java . lang . Integer , java . lang . String > multimap = this . < java . lang . Integer , java . lang . String > classUnderTest ( ) . newWithAll ( 1 , Lists . mutable . with ( "1" , "2" , "3" ) ) . newWithAll ( 2 , Lists . mutable . with ( "2" , "3" , "4" ) ) . newWithAll ( 3 , Lists . mutable . with ( "2" , "3" , "4" , "7" , "8" , "9" ) ) ; org . eclipse . collections . api . multimap . Multimap < java . lang . String , java . lang . Integer > collectedMultimap = multimap . collectKeyMultiValues ( ( key ) -> ( key % 2 ) == 0 ? "Evens" : "Odds" , ( value ) -> ( java . lang . Integer . valueOf ( value ) ) + 1 ) ; org . eclipse . collections . api . multimap . bag . MutableBagMultimap < java . lang . String , java . lang . Integer > expectedMultimap = org . eclipse . collections . impl . multimap . bag . HashBagMultimap . newMultimap ( ) ; expectedMultimap . putAll ( "Odds" , Lists . mutable . with ( 2 , 3 , 4 , 3 , 4 , 5 , 8 , 9 , 10 ) ) ; expectedMultimap . putAll ( "Evens" , Lists . mutable . with ( 3 , 4 , 5 ) ) ; org . eclipse . collections . api . multimap . bag . ImmutableBagMultimap < java . lang . String , java . lang . Integer > expectedImmutableMultimap = expectedMultimap . toImmutable ( ) ; "<AssertPlaceHolder>" ; } toImmutable ( ) { return this ; }
org . junit . Assert . assertEquals ( expectedImmutableMultimap , collectedMultimap )
testFindCustomerDevices ( ) { org . thingsboard . server . controller . Customer customer = new org . thingsboard . server . controller . Customer ( ) ; customer . setTitle ( "Test<sp>customer" ) ; customer = doPost ( "/api/customer" , customer , org . thingsboard . server . controller . Customer . class ) ; org . thingsboard . server . common . data . id . CustomerId customerId = customer . getId ( ) ; java . util . List < org . thingsboard . server . controller . Device > devices = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < 128 ; i ++ ) { org . thingsboard . server . controller . Device device = new org . thingsboard . server . controller . Device ( ) ; device . setName ( ( "Device" + i ) ) ; device . setType ( "default" ) ; device = doPost ( "/api/device" , device , org . thingsboard . server . controller . Device . class ) ; devices . add ( doPost ( ( ( ( "/api/customer/" + ( customerId . getId ( ) . toString ( ) ) ) + "/device/" ) + ( device . getId ( ) . getId ( ) . toString ( ) ) ) , org . thingsboard . server . controller . Device . class ) ) ; } java . util . List < org . thingsboard . server . controller . Device > loadedDevices = new java . util . ArrayList ( ) ; org . thingsboard . server . common . data . page . TextPageLink pageLink = new org . thingsboard . server . common . data . page . TextPageLink ( 23 ) ; org . thingsboard . server . common . data . page . TextPageData < org . thingsboard . server . controller . Device > pageData = null ; do { pageData = doGetTypedWithPageLink ( ( ( "/api/customer/" + ( customerId . getId ( ) . toString ( ) ) ) + "/devices?" ) , new com . fasterxml . jackson . core . type . TypeReference < org . thingsboard . server . common . data . page . TextPageData < org . thingsboard . server . controller . Device > > ( ) { } , pageLink ) ; loadedDevices . addAll ( pageData . getData ( ) ) ; if ( pageData . hasNext ( ) ) { pageLink = pageData . getNextPageLink ( ) ; } } while ( pageData . hasNext ( ) ) ; java . util . Collections . sort ( devices , idComparator ) ; java . util . Collections . sort ( loadedDevices , idComparator ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return hasNext ; }
org . junit . Assert . assertEquals ( devices , loadedDevices )
issue72_JPasswordField ( ) { org . javabuilders . BuildResult r = new org . javabuilders . swing . util . SwingYamlBuilder ( "JFrame(name=keyBug):" ) { { ___ ( "-<sp>JPasswordField(name=password)" ) ; } } . build ( this ) ; javax . swing . JPasswordField jpf = ( ( javax . swing . JPasswordField ) ( r . get ( "password" ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { int pos = key . indexOf ( "." ) ; if ( pos < 0 ) { return org . javabuilders . util . JBStringUtils . getDisplayName ( key ) ; } else { return org . javabuilders . util . JBStringUtils . getDisplayName ( key . substring ( ( pos + 1 ) ) ) ; } }
org . junit . Assert . assertNotNull ( jpf )
testGetEnzymeName ( ) { java . lang . String expResult = "Alcohol<sp>dehydrogenase" ; java . lang . String result = instance . getEnzymeName ( ) ; "<AssertPlaceHolder>" ; } getEnzymeName ( ) { return fields . getName ( ) . stream ( ) . findFirst ( ) . orElse ( "" ) ; }
org . junit . Assert . assertEquals ( expResult , result )
testListIteration ( ) { org . owasp . esapi . logging . cleaning . LogScrubber scrub1 = org . mockito . Mockito . mock ( org . owasp . esapi . logging . cleaning . LogScrubber . class ) ; org . owasp . esapi . logging . cleaning . LogScrubber scrub2 = org . mockito . Mockito . mock ( org . owasp . esapi . logging . cleaning . LogScrubber . class ) ; org . owasp . esapi . logging . cleaning . CompositeLogScrubber scrubber = new org . owasp . esapi . logging . cleaning . CompositeLogScrubber ( java . util . Arrays . asList ( scrub1 , scrub2 ) ) ; java . lang . String msg1 = "start" ; java . lang . String msg2 = "scrub1<sp>return" ; java . lang . String msg3 = "scrub2<sp>return" ; org . mockito . Mockito . when ( scrub1 . cleanMessage ( msg1 ) ) . thenReturn ( msg2 ) ; org . mockito . Mockito . when ( scrub2 . cleanMessage ( msg2 ) ) . thenReturn ( msg3 ) ; java . lang . String cleaned = scrubber . cleanMessage ( msg1 ) ; org . mockito . Mockito . verify ( scrub1 , org . mockito . Mockito . times ( 1 ) ) . cleanMessage ( msg1 ) ; org . mockito . Mockito . verify ( scrub2 , org . mockito . Mockito . times ( 1 ) ) . cleanMessage ( msg2 ) ; "<AssertPlaceHolder>" ; } cleanMessage ( java . lang . String ) { return message . replace ( org . owasp . esapi . logging . cleaning . NewlineLogScrubber . NEWLINE , org . owasp . esapi . logging . cleaning . NewlineLogScrubber . LINE_WRAP_REPLACE ) . replace ( org . owasp . esapi . logging . cleaning . NewlineLogScrubber . CARRIAGE_RETURN , org . owasp . esapi . logging . cleaning . NewlineLogScrubber . LINE_WRAP_REPLACE ) ; }
org . junit . Assert . assertEquals ( msg3 , cleaned )