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

Test Case for org.openmrs.module.dhisreport.api.adx Package #44

Merged
merged 1 commit into from Aug 3, 2016

Conversation

@puevigreven
Copy link
Contributor

commented Jul 30, 2016

No description provided.

try {
date3 = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(2016, 06, 14));
} catch (DatatypeConfigurationException e) {
e.printStackTrace();

This comment has been minimized.

Copy link
@dkayiwa

dkayiwa Aug 3, 2016

Member

Don't you just wanna let this bubble through instead of catching it?

is = new ByteArrayInputStream(xml.getBytes("UTF-8"));

} catch (Exception e) {
e.printStackTrace();

This comment has been minimized.

Copy link
@dkayiwa

dkayiwa Aug 3, 2016

Member

Same as for the above exception comment.

public class AdxTypeTest {

@Test
public void test() throws JAXBException, FileNotFoundException, XPathExpressionException {

This comment has been minimized.

Copy link
@dkayiwa

dkayiwa Aug 3, 2016

Member

Can we change the method name to tell exactly what we are testing?

@puevigreven puevigreven force-pushed the puevigreven:DRM-25-ADX branch from c828aef to 63542c6 Aug 3, 2016

@puevigreven

This comment has been minimized.

Copy link
Contributor Author

commented Aug 3, 2016

@dkayiwa I have tried to fix the issues. Is there ok?

public class AdxTypeTest {

@Test
public void ShouldHaveProperValuesInAllAttributesOfAdxType() throws JAXBException, FileNotFoundException,

This comment has been minimized.

Copy link
@dkayiwa

dkayiwa Aug 3, 2016

Member

Can you change the method name to match these conventions? http://www.oracle.com/technetwork/java/codeconventions-135099.html

@@ -0,0 +1,107 @@
package org.openmrs.module.dhisreport.api.adx;

import static org.junit.Assert.*;

This comment has been minimized.

Copy link
@dkayiwa

dkayiwa Aug 3, 2016

Member

We also do not encourage using wild card imports as per https://wiki.openmrs.org/display/docs/Coding+Conventions

@puevigreven puevigreven force-pushed the puevigreven:DRM-25-ADX branch 2 times, most recently from b8c0dfa to f8d242b Aug 3, 2016

AdxTypeTest.java
changing names

small change

small changes in name
@puevigreven

This comment has been minimized.

Copy link
Contributor Author

commented Aug 3, 2016

@dkayiwa thank you for reviewing it. I have tried to fix the issues.

@dkayiwa

This comment has been minimized.

Copy link
Member

commented Aug 3, 2016

@puevigreven thanks for the fast response. I just noticed that a fresh checkout of the module fails with a compiler error. Do you think you can look into it?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project dhisreport-api: Compilation failure
[ERROR] /Projects/openmrs/dhisreport/api/src/main/java/org/openmrs/module/dhisreport/api/impl/DHIS2ReportingServiceImpl.java:[324,30] cannot access org.openmrs.calculation.patient.PatientCalculationContext
[ERROR] class file for org.openmrs.calculation.patient.PatientCalculationContext not found

@puevigreven

This comment has been minimized.

Copy link
Contributor Author

commented Aug 3, 2016

@dkayiwa I compiled branches master,DRM-25-ImportSummaries,DRM-25-IMPL, DRM-25-ADX and all passed successfully.
can you Please check once again if still the error persist.
I will be happy to look into it.

@dkayiwa

This comment has been minimized.

Copy link
Member

commented Aug 3, 2016

@puevigreven oh i see! I was using Java 1.8
Reverting to java 1.7 makes all well. :)

@dkayiwa

This comment has been minimized.

Copy link
Member

commented Aug 3, 2016

@puevigreven just reverted this because it failed locally for me with: Failed tests: shouldHaveProperValuesInAllAttributesOfAdxType(org.openmrs.module.dhisreport.api.adx.AdxTypeTest): expected:<...07-14T00:00:00.000+0[5:3]0> but was:<...07-14T00:00:00.000+0[3:0]0>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.