Generator-jhipster: Gateway generation : Unit test failed on windows

Created on 22 May 2017  路  11Comments  路  Source: jhipster/generator-jhipster

Overview of the issue

After generating a gateway via Jhipster 4.5.1, I run the following command on a windows system

mvnw package

Unfortunately I have the result :

~
Failed tests:
WebConfigurerTest.testCustomizeServletContainer:114 expected:<"target[/]www"> but was:<"target[]www">
~

Suggest a Fix

Using File.separator instead of "/" in the unit test WebConfigurerTest.testCustomizeServletContainer

       String targetPath= "target" + File.separator +"www";
       assertThat(container.getDocumentRoot().getPath()).isEqualTo(targetPath);
JHipster Version(s)

4.5.1

JHipster configuration
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.xxx"
    },
    "jhipsterVersion": "4.5.1",
    "baseName": "gatewayGp",
    "packageName": "com.xxx",
    "packageFolder": "com/xxx",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "hazelcast",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "jwtSecretKey": "...",
    "clientFramework": "angular2",
    "useSass": true,
    "clientPackageManager": "yarn",
    "applicationType": "gateway",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": false
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

N/A

Browsers and Operating System

Windows 7

area

All 11 comments

That really depends on the options you selected, could you please follow the guidelines and post your .yo-rc.json

I have updated the issue

I had done the same exact code changes as mentioned in the suggested fix and can confirm it works on Windows 10 now.

could you please submit a PR?

Yes that would be great, as we don't have Windows!

I will wait for @hamark , if he doesn't do PR, I will. My issues are stacking up again... I'll try to submit a few more issues/fixes.

I'm going to do a PR today

I noticed that too and it is fixed with PR #5812...

I've push a PR #5860 to fix this bug.

@Metavirulent I tried your fix, but i still had the problem.

Just tried to build image with docker-compose -f src/main/docker/app.yml up in Windows 10 and got:

 WebConfigurerTest.testCustomizeServletContainer:88 expected:<"[]target\www"> but was:<"[C:\Users\hihor\Documents\hello-worlds\myApp\]target\www">

Same error? I'm new to JHipster...

@carrbrpoa Please don't comment on an old issue.
If you think this issue still applies, please create a new ticket with proper details.

If you have a question please use Stack Overflow, and tag the question with jhipster. This helps the project to keep the issue tracker clean. Also, Stack Overflow will give your question a larger audience:

  • This will increase your chances to get an answer
  • Answers will be of higher quality, as there is a voting system
  • This will also help other users who might have the same issue, as questions are tagged and easily searchable
Was this page helpful?
0 / 5 - 0 ratings