Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Import the CLAMP project into your IDE
  2. Eclipse only: Add the following Eclipse profile to pom.xml for Eclipse m2e support, then run Maven->Update

    Code Block
    languagexml
    linenumberstrue
    collapsetrue
            <profile>
                <!--This profile is used to store Eclipse m2e settings only. It has no 
                    influence on the Maven build itself. -->
                <id>only-eclipse</id>
                <activation>
                    <property>
                        <name>m2e.version</name>
                    </property>
                </activation>
                <build>
                    <pluginManagement>
                        <plugins>
                            <plugin>
                                <groupId>org.eclipse.m2e</groupId>
                                <artifactId>lifecycle-mapping</artifactId>
                                <version>1.0.0</version>
                                <configuration>
                                    <lifecycleMappingMetadata>
                                        <pluginExecutions>
                                            <pluginExecution>
                                                <pluginExecutionFilter>
                                                    <groupId>de.jpdigital</groupId>
                                                    <artifactId>hibernate52-ddl-maven-plugin</artifactId>
                                                    <versionRange>[2.2.0,)</versionRange>
                                                    <goals>
                                                        <goal>gen-ddl</goal>
                                                    </goals>
                                                </pluginExecutionFilter>
                                                <action>
                                                    <execute />
                                                </action>
                                            </pluginExecution>
                                            <pluginExecution>
                                                <pluginExecutionFilter>
                                                    <groupId>org.codehaus.groovy.maven</groupId>
                                                    <artifactId>gmaven-plugin</artifactId>
                                                    <versionRange>[1.0,)</versionRange>
                                                    <goals>
                                                        <goal>execute</goal>
                                                    </goals>
                                                </pluginExecutionFilter>
                                                <action>
                                                    <execute />
                                                </action>
                                            </pluginExecution>
                                            <pluginExecution>
                                                <pluginExecutionFilter>
                                                    <groupId>org.codehaus.mojo</groupId>
                                                    <artifactId>exec-maven-plugin</artifactId>
                                                    <versionRange>[1.3.2,)</versionRange>
                                                    <goals>
                                                        <goal>exec</goal>
                                                    </goals>
                                                </pluginExecutionFilter>
                                                <action>
                                                    <execute />
                                                </action>
                                            </pluginExecution>
                                            <pluginExecution>
                                                <pluginExecutionFilter>
                                                    <groupId>com.github.eirslett</groupId>
                                                    <artifactId>frontend-maven-plugin</artifactId>
                                                    <versionRange>[1.8.0,)</versionRange>
                                                    <goals>
                                                        <goal>npm</goal>
                                                    </goals>
                                                </pluginExecutionFilter>
                                                <action>
                                                    <execute />
                                                </action>
                                            </pluginExecution>
                                        </pluginExecutions>
                                    </lifecycleMappingMetadata>
                                </configuration>
                            </plugin>
                        </plugins>
                    </pluginManagement>
                </build>
            </profile>


Running unit tests locally

In order to run the unit tests locally, you need to run an instance of MariaDB and an instance of the emulator for the REST endpoints CLAMP uses. You also need to set some variables in a number of configuration files.

  1. Open a console and go into the directory extra/bin-for-dev

    Code Block
    languagebash
    cd extra/bin-for-dev


  2. Start an instance of the CLAMP MaraDB database in Docker using the helper script. This script uses docker-compose to bring up an instance of the CLAMP MariaDB.

    Code Block
    languagebash
    ./start-db.sh


  3. Start an instance of the CLAMP endpoint emulator in Docker using the helper script. This script uses docker-compose to bring up an instance of the CLAMP endpoint emulator.

    Code Block
    languagebash
    ./start-emulator.sh


  4. Check that the database and emulator are running

    Code Block
    languagebash
    docker ps

    You should see the two images running

    Code Block
    languagebash
    CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                    NAMES
    93cffd7e7d2e        python:2-slim       "/bin/sh -c 'pip ins…"   7 seconds ago        Up 7 seconds        0.0.0.0:8085->8085/tcp   clamp_third-party-proxy_1
    0b26d68f4048        mariadb:10.5.4      "docker-entrypoint.s…"   About a minute ago   Up About a minute   0.0.0.0:3306->3306/tcp   clamp_db_1