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

added simple counter test #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

dahliamalkhi
Copy link
Member

@dahliamalkhi dahliamalkhi commented Jun 29, 2016

This change is Reviewable

@no2chem
Copy link
Member

no2chem commented Jun 29, 2016

bin/airline, line 0 [r1] (raw file):
Why was this file deleted? I guess if you want another example, you should create a new file "counter" and symlink it to run_example. run_example.sh should probably check $0 and call the correct class.


Comments from Reviewable

@no2chem
Copy link
Member

no2chem commented Jun 29, 2016

Review status: 0 of 3 files reviewed at latest revision, 4 unresolved discussions.


src/main/java/org/corfudb/example/org/corfudb/example/counter/SimpleCounterExample.java, line 35 [r1] (raw file):

    }

    public static class SharedCounter implements ICorfuSMRObject {

You actually shouldn't need to implement ICorfuSMRObject.


src/main/java/org/corfudb/example/org/corfudb/example/counter/SimpleCounterExample.java, line 64 [r1] (raw file):

        SharedCounter cnt = simpleCounterExample.getSharedCounter();
        cnt.setCnt(44);
        assert cnt.getCnt() == 44;

An assertion is a bit strange here. Shouldn't you print the values out? Otherwise the person running the test won't see anything.


src/test/java/org/corfudb/example/counter/SimpleCounterTest.java, line 49 [r1] (raw file):

        SimpleCounterExample.SharedCounter cnt = simpleCounter.getSharedCounter();
        cnt.setCnt(44);
        assert cnt.getCnt() == 44;

You should use the assertJ package (assertThat()), used throughout the rest of Corfu instead of the Java assert statement.


Comments from Reviewable

@dahliamalkhi
Copy link
Member Author

Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful.


src/main/java/org/corfudb/example/org/corfudb/example/counter/SimpleCounterExample.java, line 35 [r1] (raw file):

Previously, no2chem (Michael Wei) wrote…

You actually shouldn't need to implement ICorfuSMRObject.

OK, removing. However, the airline example does this .. I copied from it.

src/main/java/org/corfudb/example/org/corfudb/example/counter/SimpleCounterExample.java, line 64 [r1] (raw file):

Previously, no2chem (Michael Wei) wrote…

An assertion is a bit strange here. Shouldn't you print the values out? Otherwise the person running the test won't see anything.

sure, ok.

src/test/java/org/corfudb/example/counter/SimpleCounterTest.java, line 49 [r1] (raw file):

Previously, no2chem (Michael Wei) wrote…

You should use the assertJ package (assertThat()), used throughout the rest of Corfu instead of the Java assert statement.

done

bin/airline, line [r1] (raw file):

Previously, no2chem (Michael Wei) wrote…

Why was this file deleted? I guess if you want another example, you should create a new file "counter" and symlink it to run_example. run_example.sh should probably check $0 and call the correct class.

looks like another artifact of git problem syncying bin directory. I'll revert this change.

Comments from Reviewable

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

Successfully merging this pull request may close these issues.

2 participants