Sunday, September 24, 2017

chmod permission list

Hi...

To see the bit of OS
getconf LONG_BIT 

Permission command(chmod):-

CommandMeaning
chmod 400 fileTo protect a file against accidental overwriting.
chmod 500 directoryTo protect yourself from accidentally removing, renaming or moving files from this directory.
chmod 600 fileA private file only changeable by the user who entered this command.
chmod 644 fileA publicly readable file that can only be changed by the issuing user.
chmod 660 fileUsers belonging to your group can change this file, others don't have any access to it at all.
chmod 700 fileProtects a file against any access from other users, while the issuing user still has full access.
chmod 755 directoryFor files that should be readable and executable by others, but only changeable by the issuing user.
chmod 775 fileStandard file sharing mode for a group.
chmod 777 fileEverybody can do everything to this file.

To unzip file


tar xvzf file-1.0.tar.gz - to uncompress a gzip tar file (.tgz or .tar.gz)

Resource Link: http://sabbirahamed.blogspot.com/2014/02/simple-usefull-linux-command.html

10 OOAD (Object orientation analysis and design) principles.

1) Open Closed Principle (OCP): -
Code should be open for extension and close for modification.

2) Liskov Substitution Principle (LSP): -
 Every function which operates upon a reference or a pointer to a base class should be able to operate upon derivatives of that base class without knowing it.

3) Dependency Inversion Principle (DIP): -
 High level modules should not depend upon low level modules. Both should depend upon abstraction. Abstraction should not depend upon details. Details should depend upon abstraction.

4) Interface segregation Principle (ISP): - 
Client should not be forced to depend upon interfaces that they do not use. Many client specific interface are better then one general purpose interface.


5) Release Reuse Equivalency Principle (REP): -
 The granule of reuse is the granule of release. Users will be unwilling to use the element if they need or forced to upgrade every time author changes it.

6) Common Closure Principle (CCP): - 
Classes those changes together belong together. The more packages that change in any given release, the greater the work to rebuild, test and deploy the release. So they should be grouped together.

7) Common Reuse Principle (CRP): - 
Classes that are not used together should not be grouped together. A dependency upon a package is a dependency upon everything in the package. When a package changes, and its release number is bumped , all clients of that package must verify that they work with the new package even if nothing they used within package actually changed.

8) Acyclic Dependencies Principle (ADP): - 
The dependencies between packages must not form cycles.

9) Stable Dependencies Principle (SDP): - 
Depend in the direction of stability. A package with lots of incoming dependencies is very stable because it requires a great deal of work to reconcile any changes with all the dependent packages.

10) Stable Abstraction Principle (SAP): -
 Stable packages should be abstract packages. The SAP I sjust a restatement of the DIP. It states that the packages that are most dependent upon (i.e. stable) should also be most abstract.

Resource Link: http://sabbirahamed.blogspot.com/

Sunday, September 17, 2017

JUnit Issues

Issue#1:


by adding @EnableWebMvc you just disable what spring-boot autoconfiguring for you.


If you want to keep Spring Boot MVC features, and you just want to add additional MVC configuration (interceptors, formatters, view controllers etc.) you can add your own @Configuration class of type WebMvcConfigurerAdapter, but without @EnableWebMvc. If you wish to provide custom instances of RequestMappingHandlerMapping,RequestMappingHandlerAdapter or ExceptionHandlerExceptionResolver you can declare a WebMvcRegistrationsAdapter instance providing such components.

https://stackoverflow.com/a/41543718/2293534



Thursday, September 14, 2017

Spring boot testing another

https://github.com/matsev/spring-testing/blob/master/src/test/java/com/jayway/application/BankApplicationTest.java
http://javasampleapproach.com/testing/unit-test-for-spring-mvc-controller-with-spring-boot
http://memorynotfound.com/unit-test-spring-mvc-rest-service-junit-mockito/
https://github.com/ptahchiev/spring-boot-mockmvc
https://spring.io/guides/gs/testing-web/
https://static.javadoc.io/org.mockito/mockito-core/1.10.19/org/mockito/Mockito.html
https://medium.com/@gustavo.ponce.ch/spring-boot-spring-mvc-spring-security-mysql-a5d8545d837d



https://static.javadoc.io/org.mockito/mockito-core/1.10.19/org/mockito/Mockito.html
https://medium.com/@gustavo.ponce.ch/spring-boot-spring-mvc-spring-security-mysql-a5d8545d837d
https://www.youtube.com/watch?v=bExyU7XaosA&list=PL0951947FC3CB5BB3&index=10
https://www.youtube.com/watch?v=UwKSvLXtPLI&index=13&list=PLOBJG9s3E5qT6c9ICpFp9Gn9flsK4gvqM
https://medium.com/@gustavo.ponce.ch/spring-boot-restful-junit-mockito-hamcrest-eclemma-5add7f725d4e
http://www.springboottutorial.com/integration-testing-for-spring-boot-rest-services
https://stackoverflow.com/questions/10906945/mockito-junit-and-spring
https://solutiondesign.com/blog/-/blogs/spring-and-mockito-happy-together
http://www.lucassaldanha.com/unit-and-integration-tests-in-spring-boot/
https://blog.codecentric.de/en/2017/02/integration-testing-strategies-spring-boot-microservices/
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html
http://www.baeldung.com/injecting-mocks-in-spring
https://stackoverflow.com/questions/20542361/mocking-apache-httpclient-using-mockito
https://code.tutsplus.com/tutorials
https://code.tutsplus.com/tutorials/testing-and-dependency-injection-with-model-view-presenter-on-android--cms-26164
https://www.tutorialspoint.com/mockito/

Tuesday, September 12, 2017

Java fork join framework

JUnit Mockito Tutorials


  1. https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html
  2. http://www.baeldung.com/spring-boot-testing
  3. https://www.blazemeter.com/blog/spring-boot-rest-api-unit-testing-with-junit
  4. https://dzone.com/articles/unit-and-integration-tests-in-spring-boot
  5. http://www.vogella.com/tutorials/Mockito/article.html
  6. http://www.vogella.com/tutorials/JUnit/article.html
  7. https://dzone.com/articles/getting-started-mocking-java
  8. https://www.tutorialspoint.com/mockito/
  9. https://examples.javacodegeeks.com/core-java/mockito/junit-mockito-example/
  10. https://www.udemy.com/mockito-tutorial-with-junit-examples/
  11. http://automationrhapsody.com/mock-junit-tests-mockito-example/
  12. https://github.com/in28minutes/MockitoTutorialForBeginners
  13. https://github.com/in28minutes/MockitoIn28Minutes/blob/master/Mockito%20Tutorial%20For%20Beginners.pdf

<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.8.10</version>
</dependency>

Hibernate: validate to update[make it]

Friday, September 8, 2017

marshalling and spring boot study

http://blog.bdoughan.com/2010/08/creating-restful-web-service-part-55.html
http://blog.bdoughan.com/2012/11/creating-generic-list-wrapper-in-jaxb.html
https://stackoverflow.com/questions/6467119/spring-mvc-rest-response-json-and-xml
http://springinpractice.com/2012/02/22/supporting-xml-and-json-web-service-endpoints-in-spring-3-1-using-responsebody/
http://springinpractice.com/2011/12/06/jackson-json-jaxb2-xml-spring/
https://stackoverflow.com/questions/27010315/how-to-use-spring-boot-rest-data-to-return-xml
https://github.com/sergpank/spring-boot-xml/blob/master/src/main/java/com/exmaple/RestfulClient.java
http://javasampleapproach.com/java-integration/convert-java-object-intofrom-xml-spring-boot
http://www.javainterviewpoint.com/spring-rest-hello-world-example/
https://github.com/jasonray/jersey-starterkit/wiki/serializing-a-pojo-to-xml-or-json-using-jaxb
http://www.journaldev.com/8934/spring-rest-xml-and-json-example
https://www.intertech.com/Blog/jaxb-tutorial-how-to-marshal-and-unmarshal-xml/
https://www.mkyong.com/spring3/spring-objectxml-mapping-example/
https://www.javatpoint.com/spring-and-jaxb-integration-example
http://www.concretepage.com/spring/spring-oxm-marshaller-unmarshaller-annotation-example-with-castor
http://websystique.com/java/jaxb/jaxb-helloworld-example-marshal-unmarshal-example/
https://www.java-success.com/jaxb-with-spring-orm-for-marshaling-tutorial/
https://www.dineshonjava.com/jaxb-unmarshalling-example/
https://stackoverflow.com/questions/44676532/how-to-use-spring-to-marshal-and-unmarshal-xml
https://stackoverflow.com/questions/16003005/problems-with-jaxb-xml-parsing
https://stackoverflow.com/questions/18783683/how-to-create-model-class-for-xml-parsing-which-has-iteration-of-element

Thursday, September 7, 2017

tomcat install in windows manually

Spring boot study

https://github.com/arpitmandliya/SpringBootHibernateExample
https://github.com/lakshmandev/SpringBoot/blob/master/src/main/java/com/example/controller/web/GreetingsController.java
https://github.com/farrukhmpk/html-pdf-service/tree/master/src/main/java/org/farrukh/mirza/pdf/spi
https://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/
http://viralpatel.net/blogs/spring-4-mvc-rest-example-json/
https://avaldes.com/spring-restful-web-service-example-with-json-and-jackson-using-spring-tool-suite/
http://www.beingjavaguys.com/2014/08/spring-restful-web-services.html
https://github.com/Spidertracks/spring-rest-api-demo
http://www.concretepage.com/spring-4/spring-4-rest-web-service-json-example-tomcat
https://www.java2blog.com/spring-boot-hibernate-example/
http://websystique.com/springmvc/spring-4-mvc-rest-service-example-using-restcontroller/
http://www.journaldev.com/2552/spring-rest-example-tutorial-spring-restful-web-services

Algorithms are here