Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking existance of config file before processing target file. #1267

Closed
romani opened this issue Jul 1, 2015 · 16 comments
Closed

Checking existance of config file before processing target file. #1267

romani opened this issue Jul 1, 2015 · 16 comments
Assignees
Milestone

Comments

@romani
Copy link
Member

romani commented Jul 1, 2015

3004b4d that commit was reverted, please review #1265.

Write provide integration tests and UTs for Main to avoid such cases in future.

@romani romani added the approved label Jul 1, 2015
romani added a commit that referenced this issue Jul 1, 2015
@romani
Copy link
Member Author

romani commented Jul 1, 2015

@Bhavik3 , please address.

@Bhavik3
Copy link
Contributor

Bhavik3 commented Jul 1, 2015

@romani
From Main, How can I check for -jar option?

@romani
Copy link
Member Author

romani commented Jul 1, 2015

@Bhavik3
Copy link
Contributor

Bhavik3 commented Jul 1, 2015

My solution is to:
First check for config location as we did before.
If file not exist in that way, check for config location in classpath
If still not exist then give error message.

Is it fine?

@romani
Copy link
Member Author

romani commented Jul 1, 2015

yes

@Bhavik3
Copy link
Contributor

Bhavik3 commented Jul 1, 2015

ok
I implemented it. works fine.
But, how can I write UT for it.

@romani
Copy link
Member Author

romani commented Jul 1, 2015

try to create a file in target folder ..... need to be investigateds

@Bhavik3
Copy link
Contributor

Bhavik3 commented Jul 1, 2015

@romani

Intermediate solution:
Bhavik3@5369f35

problem is naming of jar file in target folder....(can differ by version)

Or, have other method to generate jar in pre-defined name.

@Bhavik3
Copy link
Contributor

Bhavik3 commented Jul 3, 2015

@romani
Have you check this out?

@romani
Copy link
Member Author

romani commented Jul 3, 2015

not yet, but I will for sure.

You can do smth else meanwhile.

@romani
Copy link
Member Author

romani commented Jul 3, 2015

  1. You need to create integration test , not a UTs
    Please review https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#A_Build_Lifecycle_is_Made_Up_of_Phases
    ITs are next step after package.

You need to create new package there:
https://github.com/checkstyle/checkstyle/tree/master/src/it/java
as "com/puppycrawl/tools/checkstyle" and create a new test file , that will be launched during ITs phase only.

mvn clean package -Passembly -Dlinkcheck.skip=true

maven should do that for for you, please review options of http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html to not hardcode any strict version and build commands in ITs files.

@Bhavik3
Copy link
Contributor

Bhavik3 commented Jul 31, 2015

@romani
I am poor working with maven. I can't find how to generate Jar file.
Never worked on Integration test. Need help here..

@romani
Copy link
Member Author

romani commented Aug 5, 2015

Never worked on Integration test.

ITs are just another UTs but working after package phase is done , so they could test binaries as it would be done by user.

I can't find how to generate Jar file.

https://github.com/checkstyle/checkstyle/blob/master/config/assembly-bin.xml#L14 here is how "-all" jar is generated. Please update that config to gnerate the same content jar but without version there.

Here is maven plugin - https://github.com/checkstyle/checkstyle/blob/master/pom.xml#L1034 that responsible for "all" jar generation. That plugin exists in special profile, so it will not be launched in general maven build till "-Passembly" is specified. So we need to investigate a way to do "all" jar generation during general build too.

Or we could think about running ITs over checkstyle-6.8.2.jar but classpath need to be setup for it.

Please continue investigation of maven, If you run into problem let me know - I will help you.

@Bhavik3
Copy link
Contributor

Bhavik3 commented Aug 13, 2015

@romani
I don't know how to generate -all jar. You can assign it to someone. I don't think I can find some maven plugin to generate jar with particular name.

@romani
Copy link
Member Author

romani commented Aug 13, 2015

It is ok, task is not simple.

Alljar is generated by mvn clean package -Passembly

@romani
Copy link
Member Author

romani commented Nov 3, 2015

merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants