PharmEasyEngg / lampo

Lampo is developed to run appium mobile automation scripts on mobile devices connected to remote machines. It also aims at allowing users to interact with remotely connected devices for manual testing.
Other
42 stars 6 forks source link

Compilation Error #6

Open rahulsharma1987 opened 1 year ago

rahulsharma1987 commented 1 year ago

Implementaion of addPhoto(photo) missing in service class PhoneImageService. Please look into this below snippet from controller call PhoneImageController

@PostMapping("/add") public String addPhoto(@RequestParam("name") String name, @RequestParam("file") MultipartFile file) throws IOException {

    Collection<Photo> _photo = getPhotoByName(name);
    Photo photo = null;
    if (_photo.isEmpty()) {
        photo = new Photo();
        photo.setName(name);
        photo.setImage(new Binary(BsonBinarySubType.BINARY, file.getBytes()));
        photo = service.addPhoto(photo);
    } else {
        photo = _photo.stream().findAny().get();
    }
    return photo.getId();
}

@GetMapping
public Collection<Photo> getPhotoByName(@RequestParam String name) {
    return service.getPhotoByName(name);
}
Sivasankaramalan commented 1 year ago

@sarathpharmeasy is there any update on the issue? Facing similar issue

shashanks293 commented 1 year ago

@sarathpharmeasy I am also facing this issue, do we have a fix for this?

shashanks293 commented 1 year ago

@rahulsharma1987 were you able to resolve this issue?

sarathpharmeasy commented 1 year ago

@shashanks293 @rahulsharma1987 @Sivasankaramalan apologies for the delay. Kindly take a pull and retry.

shashanks293 commented 1 year ago

@sarathpharmeasy now HomeController.getPhoneImage() has compilation issue in return phoneImageService.getPhotoByName(name).stream().findFirst().orElseGet("default");

also if I somehow fix this compilation issue then build fails because of a test

DeviceLabMasterApplicationTests > contextLoads() FAILED java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132 Caused by: org.springframework.beans.factory.BeanCreationException at InitDestroyAnnotationBeanPostProcessor.java:160 Caused by: org.springframework.amqp.AmqpConnectException at RabbitExceptionTranslator.java:61 Caused by: java.net.ConnectException at PlainSocketImpl.java:-2

sarathpharmeasy commented 1 year ago

@shashanks293 you can skip the test using ./gradlew clean build -x test

avinashawast commented 1 year ago

@sarathpharmeasy @shashanks293 Can you push the fix you did for typecasting problem?

sarathpharmeasy commented 1 year ago

@avinashawast @Sivasankaramalan @rahulsharma1987 can you please pull from master branch and try now?

rahulsharma1987 commented 1 year ago

hi @sarathpharmeasy

Tried with latest master branch and getting below error .Find the below output from the ./gradlew clean build bootWar executed on terminal

rahulsharma@197NODMB40704 master % ./gradlew clean build bootWar

Task :test

DeviceLabMasterApplicationTests > contextLoads() FAILED java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132 Caused by: org.springframework.beans.factory.BeanCreationException at InitDestroyAnnotationBeanPostProcessor.java:160 Caused by: org.springframework.amqp.AmqpConnectException at RabbitExceptionTranslator.java:61 Caused by: java.net.ConnectException at PlainSocketImpl.java:-2

1 test completed, 1 failed

Task :test FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 36s 8 actionable tasks: 8 executed


2.) Tried to execute this ./gradlew clean build -x test and build created successfully but after running java -jar build/libs/master.war getting below message no main manifest attribute, in build/libs/master.war

@sarathpharmeasy - Can you look into this?