|
21 | 21 | describe JavaBuildpack::Framework::JrebelAgent do |
22 | 22 | include_context 'component_helper' |
23 | 23 |
|
24 | | - it 'does not detect without JRebel config files present' do |
| 24 | + it 'does not detect when rebel-remote.xml is not present' do |
25 | 25 | expect(component.detect).to be_nil |
26 | 26 | end |
27 | 27 |
|
28 | | - it 'detects with JRebel config files are present', |
29 | | - app_fixture: 'framework_jrebel_app', |
30 | | - cache_fixture: 'stub-jrebel-archive.zip' do |
| 28 | + it 'detects when rebel-remote.xml is present in the top-level directory', |
| 29 | + app_fixture: 'framework_jrebel_app_simple' do |
| 30 | + expect(component.detect).to eq("jrebel-agent=#{version}") |
| 31 | + end |
| 32 | + |
| 33 | + it 'detects when rebel-remote.xml is present in WEB-INF/classes', |
| 34 | + app_fixture: 'framework_jrebel_app_war' do |
31 | 35 | expect(component.detect).to eq("jrebel-agent=#{version}") |
32 | 36 | end |
33 | 37 |
|
34 | | - it 'downloads JRebel agent JAR', |
35 | | - app_fixture: 'framework_jrebel_app', |
| 38 | + it 'detects when rebel-remote.xml is present inside an embedded JAR', |
| 39 | + app_fixture: 'framework_jrebel_app_war_with_jar' do |
| 40 | + expect(component.detect).to eq("jrebel-agent=#{version}") |
| 41 | + end |
| 42 | + |
| 43 | + it 'downloads the JRebel JAR and the native agent', |
| 44 | + app_fixture: 'framework_jrebel_app_simple', |
36 | 45 | cache_fixture: 'stub-jrebel-archive.zip' do |
37 | 46 |
|
38 | 47 | component.compile |
39 | 48 |
|
40 | | - expect(sandbox + "jrebel_agent-#{version}.jar").to exist |
| 49 | + expect(sandbox + 'lib/jrebel.jar').to exist |
| 50 | + expect(sandbox + 'lib/libjrebel64.so').to exist |
| 51 | + expect(sandbox + 'lib/libjrebel32.so').to exist |
41 | 52 | end |
42 | 53 |
|
43 | | - it 'updates JAVA_OPTS', |
44 | | - app_fixture: 'framework_jrebel_app', |
| 54 | + it 'adds correct arguments to JAVA_OPTS', |
| 55 | + app_fixture: 'framework_jrebel_app_simple', |
45 | 56 | cache_fixture: 'stub-jrebel-archive.zip' do |
46 | | - allow(services).to receive(:find_service).and_return('credentials' => { 'licenseKey' => 'test-license-key' }) |
| 57 | + |
| 58 | + allow(component).to receive(:architecture).and_return('x86_64') |
47 | 59 |
|
48 | 60 | component.release |
49 | 61 |
|
50 | | - expect(java_opts).to include("-javaagent:$PWD/.java-buildpack/jrebel_agent/jrebel_agent-#{version}.jar") |
| 62 | + expect(java_opts).to include('-agentpath:$PWD/.java-buildpack/jrebel_agent/lib/libjrebel64.so') |
51 | 63 | expect(java_opts).to include('-Drebel.remoting_plugin=true') |
52 | | - expect(java_opts).to include("-Xbootclasspath/p:$PWD/.java-buildpack/jrebel_agent/jrebel_agent-#{version}.jar") |
| 64 | + expect(java_opts).to include('-Drebel.log=true') |
| 65 | + expect(java_opts).to include('-Drebel.cloud.platform=cloudfoundry/java-buildpack') |
53 | 66 | end |
54 | 67 |
|
55 | 68 | end |
0 commit comments